Commit 72628474 authored by Martin Storsjö's avatar Martin Storsjö Committed by 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 34b0ec9a
...@@ -334,10 +334,16 @@ static int OpenDecoder(vlc_object_t *p_this) ...@@ -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); (*env)->CallVoidMethod(env, p_sys->codec, p_sys->configure, format, NULL, NULL, 0);
if ((*env)->ExceptionOccurred(env)) { if ((*env)->ExceptionOccurred(env)) {
msg_Warn(p_dec, "Exception occurred in MediaCodec.configure");
(*env)->ExceptionClear(env); (*env)->ExceptionClear(env);
goto error; goto error;
} }
(*env)->CallVoidMethod(env, p_sys->codec, p_sys->start); (*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->started = 1;
p_sys->input_buffers = (*env)->CallObjectMethod(env, p_sys->codec, p_sys->get_input_buffers); p_sys->input_buffers = (*env)->CallObjectMethod(env, p_sys->codec, p_sys->get_input_buffers);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment