Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a9def3d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "MediaPlayer: ensure that jni code returns after throwing exceptions." into pi-dev

parents ee9b570d 4480127c
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -384,6 +384,9 @@ android_media_MediaPlayer_getBufferingParams(JNIEnv *env, jobject thiz)
    process_media_player_call(
    process_media_player_call(
            env, thiz, mp->getBufferingSettings(&settings),
            env, thiz, mp->getBufferingSettings(&settings),
            "java/lang/IllegalStateException", "unexpected error");
            "java/lang/IllegalStateException", "unexpected error");
    if (env->ExceptionCheck()) {
        return nullptr;
    }
    ALOGV("getBufferingSettings:{%s}", settings.toString().string());
    ALOGV("getBufferingSettings:{%s}", settings.toString().string());


    return bp.asJobject(env, gBufferingParamsFields);
    return bp.asJobject(env, gBufferingParamsFields);
@@ -555,6 +558,9 @@ android_media_MediaPlayer_getPlaybackParams(JNIEnv *env, jobject thiz)
    process_media_player_call(
    process_media_player_call(
            env, thiz, mp->getPlaybackSettings(&audioRate),
            env, thiz, mp->getPlaybackSettings(&audioRate),
            "java/lang/IllegalStateException", "unexpected error");
            "java/lang/IllegalStateException", "unexpected error");
    if (env->ExceptionCheck()) {
        return nullptr;
    }
    ALOGV("getPlaybackSettings: %f %f %d %d",
    ALOGV("getPlaybackSettings: %f %f %d %d",
            audioRate.mSpeed, audioRate.mPitch, audioRate.mFallbackMode, audioRate.mStretchMode);
            audioRate.mSpeed, audioRate.mPitch, audioRate.mFallbackMode, audioRate.mStretchMode);


@@ -623,6 +629,9 @@ android_media_MediaPlayer_getSyncParams(JNIEnv *env, jobject thiz)
    process_media_player_call(
    process_media_player_call(
            env, thiz, mp->getSyncSettings(&scp.sync, &scp.frameRate),
            env, thiz, mp->getSyncSettings(&scp.sync, &scp.frameRate),
            "java/lang/IllegalStateException", "unexpected error");
            "java/lang/IllegalStateException", "unexpected error");
    if (env->ExceptionCheck()) {
        return nullptr;
    }


    ALOGV("getSyncSettings: %d %d %f %f",
    ALOGV("getSyncSettings: %d %d %f %f",
            scp.sync.mSource, scp.sync.mAudioAdjustMode, scp.sync.mTolerance, scp.frameRate);
            scp.sync.mSource, scp.sync.mAudioAdjustMode, scp.sync.mTolerance, scp.frameRate);
+9 −0
Original line number Original line Diff line number Diff line
@@ -495,6 +495,9 @@ android_media_MediaPlayer2_getBufferingParams(JNIEnv *env, jobject thiz)
    process_media_player_call(
    process_media_player_call(
            env, thiz, mp->getBufferingSettings(&settings),
            env, thiz, mp->getBufferingSettings(&settings),
            "java/lang/IllegalStateException", "unexpected error");
            "java/lang/IllegalStateException", "unexpected error");
    if (env->ExceptionCheck()) {
        return nullptr;
    }
    ALOGV("getBufferingSettings:{%s}", settings.toString().string());
    ALOGV("getBufferingSettings:{%s}", settings.toString().string());


    return bp.asJobject(env, gBufferingParamsFields);
    return bp.asJobject(env, gBufferingParamsFields);
@@ -662,6 +665,9 @@ android_media_MediaPlayer2_getPlaybackParams(JNIEnv *env, jobject thiz)
    process_media_player_call(
    process_media_player_call(
            env, thiz, mp->getPlaybackSettings(&audioRate),
            env, thiz, mp->getPlaybackSettings(&audioRate),
            "java/lang/IllegalStateException", "unexpected error");
            "java/lang/IllegalStateException", "unexpected error");
    if (env->ExceptionCheck()) {
        return nullptr;
    }
    ALOGV("getPlaybackSettings: %f %f %d %d",
    ALOGV("getPlaybackSettings: %f %f %d %d",
            audioRate.mSpeed, audioRate.mPitch, audioRate.mFallbackMode, audioRate.mStretchMode);
            audioRate.mSpeed, audioRate.mPitch, audioRate.mFallbackMode, audioRate.mStretchMode);


@@ -730,6 +736,9 @@ android_media_MediaPlayer2_getSyncParams(JNIEnv *env, jobject thiz)
    process_media_player_call(
    process_media_player_call(
            env, thiz, mp->getSyncSettings(&scp.sync, &scp.frameRate),
            env, thiz, mp->getSyncSettings(&scp.sync, &scp.frameRate),
            "java/lang/IllegalStateException", "unexpected error");
            "java/lang/IllegalStateException", "unexpected error");
    if (env->ExceptionCheck()) {
        return nullptr;
    }


    ALOGV("getSyncSettings: %d %d %f %f",
    ALOGV("getSyncSettings: %d %d %f %f",
            scp.sync.mSource, scp.sync.mAudioAdjustMode, scp.sync.mTolerance, scp.frameRate);
            scp.sync.mSource, scp.sync.mAudioAdjustMode, scp.sync.mTolerance, scp.frameRate);