[vlc-commits] mediacodec: fail earlier if we don't support interlaced
Thomas Guillem
git at videolan.org
Fri Jan 20 17:01:30 CET 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jan 20 17:00:46 2017 +0100| [f4e90b1391ce1d0715c5215728d82e5f91cdee5e] | committer: Thomas Guillem
mediacodec: fail earlier if we don't support interlaced
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f4e90b1391ce1d0715c5215728d82e5f91cdee5e
---
modules/codec/omxil/mediacodec.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index ef7c14e..a0879d7 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -1386,6 +1386,17 @@ static int DecodeCommon(decoder_t *p_dec, block_t **pp_block)
goto end;
}
+ if (p_block->i_flags & BLOCK_FLAG_INTERLACED_MASK
+ && !(p_sys->api.i_quirks & MC_API_VIDEO_QUIRKS_SUPPORT_INTERLACED))
+ {
+ /* Before Android 21 and depending on the vendor, MediaCodec can
+ * crash or be in an inconsistent state when decoding interlaced
+ * videos. See OMXCodec_GetQuirks() for a white list of decoders
+ * that supported interlaced videos before Android 21. */
+ msg_Warn(p_dec, "codec doesn't support interlaced videos");
+ goto end;
+ }
+
/* Parse input block */
if ((i_ret = p_sys->pf_on_new_block(p_dec, pp_block)) != 1)
{
@@ -1601,17 +1612,6 @@ static int Video_OnNewBlock(decoder_t *p_dec, block_t **pp_block)
decoder_sys_t *p_sys = p_dec->p_sys;
block_t *p_block = *pp_block;
- if (p_block->i_flags & BLOCK_FLAG_INTERLACED_MASK
- && !(p_sys->api.i_quirks & MC_API_VIDEO_QUIRKS_SUPPORT_INTERLACED))
- {
- /* Before Android 21 and depending on the vendor, MediaCodec can crash
- * or be in an inconsistent state when decoding interlaced videos. See
- * OMXCodec_GetQuirks() for a white list of decoders that supported
- * interlaced videos before Android 21. */
- msg_Warn(p_dec, "codec doesn't support interlaced videos");
- return -1;
- }
-
timestamp_FifoPut(p_sys->video.timestamp_fifo,
p_block->i_pts ? VLC_TS_INVALID : p_block->i_dts);
More information about the vlc-commits
mailing list