[vlc-commits] MediaCodec: handle exceptions on Flush

Jean-Baptiste Kempf git at videolan.org
Wed Apr 3 15:15:31 CEST 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Apr  3 15:13:50 2013 +0200| [0103fd959a37be1ccc9ee5c59fb84f9610b0bc74] | committer: Jean-Baptiste Kempf

MediaCodec: handle exceptions on Flush

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0103fd959a37be1ccc9ee5c59fb84f9610b0bc74
---

 modules/codec/omxil/android_mediacodec.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
index dd9171e..c4b712c 100644
--- a/modules/codec/omxil/android_mediacodec.c
+++ b/modules/codec/omxil/android_mediacodec.c
@@ -506,8 +506,13 @@ static picture_t *DecodeVideo(decoder_t *p_dec, block_t **pp_block)
 
     if (p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED)) {
         block_Release(p_block);
-        if (p_sys->decoded)
+        if (p_sys->decoded) {
             (*env)->CallVoidMethod(env, p_sys->codec, p_sys->flush);
+            if ((*env)->ExceptionOccurred(env)) {
+                msg_Warn(p_dec, "Exception occurred in MediaCodec.flush");
+                (*env)->ExceptionClear(env);
+            }
+        }
         p_sys->decoded = 0;
         (*myVm)->DetachCurrentThread(myVm);
         return NULL;



More information about the vlc-commits mailing list