]> git.sesse.net Git - vlc/commitdiff
mediacodec: Check for exceptions after MediaCodec.start()
authorMartin Storsjö <martin@martin.st>
Sun, 14 Oct 2012 21:46:57 +0000 (00:46 +0300)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 14 Oct 2012 22:43:23 +0000 (00:43 +0200)
Also log a warning if MediaCodec.configure() threw an exception.

This fixes issues when playing back H264 over RTSP on devices
supporting MediaCodec - this makes it fall back cleanly to other
decoders. (The actual issue with playing back these streams is
not investigated yet.)

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/codec/omxil/android_mediacodec.c

index fa632f278f60ee67a2902c9beba6d21c6a58c60f..cbe3c5c610ad724924b27514a8f8a74fc8bb82ad 100644 (file)
@@ -334,10 +334,16 @@ static int OpenDecoder(vlc_object_t *p_this)
 
     (*env)->CallVoidMethod(env, p_sys->codec, p_sys->configure, format, NULL, NULL, 0);
     if ((*env)->ExceptionOccurred(env)) {
+        msg_Warn(p_dec, "Exception occurred in MediaCodec.configure");
         (*env)->ExceptionClear(env);
         goto error;
     }
     (*env)->CallVoidMethod(env, p_sys->codec, p_sys->start);
+    if ((*env)->ExceptionOccurred(env)) {
+        msg_Warn(p_dec, "Exception occurred in MediaCodec.start");
+        (*env)->ExceptionClear(env);
+        goto error;
+    }
     p_sys->started = 1;
 
     p_sys->input_buffers = (*env)->CallObjectMethod(env, p_sys->codec, p_sys->get_input_buffers);