[vlc-commits] mediacodec: Check for exceptions after MediaCodec.start()
Martin Storsjö
git at videolan.org
Mon Oct 15 00:43:37 CEST 2012
vlc | branch: master | Martin Storsjö <martin at martin.st> | Mon Oct 15 00:46:57 2012 +0300| [726284744819a9665b2c7f87fe9a33cfc00a2f8b] | committer: Jean-Baptiste Kempf
mediacodec: Check for exceptions after MediaCodec.start()
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 at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=726284744819a9665b2c7f87fe9a33cfc00a2f8b
---
modules/codec/omxil/android_mediacodec.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
index fa632f2..cbe3c5c 100644
--- a/modules/codec/omxil/android_mediacodec.c
+++ b/modules/codec/omxil/android_mediacodec.c
@@ -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);
More information about the vlc-commits
mailing list