Skip to content

Commit

Permalink
android/MediaCodec: only reset Vout->MediaCodec if we need surface to…
Browse files Browse the repository at this point in the history
… be switched
  • Loading branch information
bbcallen committed Oct 27, 2015
1 parent 37f0da0 commit dd2b716
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ijkmedia/ijkplayer/android/pipeline/ffpipeline_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ int ffpipeline_set_surface(JNIEnv *env, IJKFF_Pipeline* pipeline, jobject surfac
{
jobject prev_surface = opaque->jsurface;

SDL_VoutAndroid_setAMediaCodec(opaque->weak_vout, NULL);
if ((surface == prev_surface) ||
(surface && prev_surface && (*env)->IsSameObject(env, surface, prev_surface))) {
// same object, no need to reconfigure
} else {
SDL_VoutAndroid_setAMediaCodec(opaque->weak_vout, NULL);
if (surface) {
opaque->jsurface = (*env)->NewGlobalRef(env, surface);
} else {
Expand Down

0 comments on commit dd2b716

Please sign in to comment.