[vlc-devel] [RFC PATCH 12/12] mediacodec: fallback if there is no output
Thomas Guillem
thomas at gllm.fr
Tue Jul 19 19:36:34 CEST 2016
---
modules/codec/omxil/mediacodec.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index 56c432b..ee055b8 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -110,8 +110,6 @@ struct decoder_sys_t
/* If true, the first input block was successfully dequeued */
bool b_input_dequeued;
bool b_aborted;
- /* TODO: remove */
- bool b_error_signaled;
union
{
@@ -808,6 +806,7 @@ static int OpenDecoder(vlc_object_t *p_this, pf_MediaCodecApi_init pf_init)
p_dec->pf_decode_video = DecodeVideo;
p_dec->pf_decode_audio = DecodeAudio;
p_dec->pf_flush = DecodeFlush;
+ p_dec->b_can_fallback = true;
return VLC_SUCCESS;
@@ -1515,9 +1514,6 @@ static int DecodeCommon(decoder_t *p_dec, block_t **pp_block)
if (!p_sys->b_aborted)
msg_Err(p_dec, "OutThread timed out");
- /* In case pf_decode is called again (it shouldn't happen) */
- p_sys->b_error_signaled = true;
-
vlc_mutex_unlock(&p_sys->lock);
return 0;
}
@@ -1530,15 +1526,10 @@ end:
}
if (p_sys->b_aborted)
{
- if (!p_sys->b_error_signaled) {
- /* Signal the error to the Java.
- * TODO: remove this when there is a decoder fallback */
- if (p_dec->fmt_in.i_cat == VIDEO_ES)
- AWindowHandler_sendHardwareAccelerationError(VLC_OBJECT(p_dec),
- p_sys->u.video.p_awh);
- p_sys->b_error_signaled = true;
- vlc_cond_broadcast(&p_sys->cond);
- }
+ if (!p_sys->b_has_format)
+ p_dec->b_fallback = true;
+ else
+ p_dec->b_error = true;
vlc_mutex_unlock(&p_sys->lock);
return -1;
}
--
2.8.1
More information about the vlc-devel
mailing list