From ebdd78ef3e45219cc96cd2afc59eb76571f9d36e Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Thu, 23 Feb 2017 19:14:42 +0100 Subject: [PATCH] codec: faad: signal discontinuity to aout --- modules/codec/faad.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/codec/faad.c b/modules/codec/faad.c index 64a1a73690..adb5069d72 100644 --- a/modules/codec/faad.c +++ b/modules/codec/faad.c @@ -79,7 +79,7 @@ struct decoder_sys_t /* Channel positions of the current stream (for re-ordering) */ uint32_t pi_channel_positions[MAX_CHANNEL_POSITIONS]; - bool b_sbr, b_ps; + bool b_sbr, b_ps, b_discontinuity; }; static const uint32_t pi_channels_in[MAX_CHANNEL_POSITIONS] = @@ -190,6 +190,7 @@ static int Open( vlc_object_t *p_this ) /* buffer */ p_sys->p_block = NULL; + p_sys->b_discontinuity = p_sys->b_sbr = p_sys->b_ps = false; p_dec->pf_decode = DecodeBlock; @@ -402,6 +403,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block ) } Flush( p_dec ); + p_sys->b_discontinuity = true; return VLCDEC_SUCCESS; } @@ -411,6 +413,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block ) msg_Warn( p_dec, "invalid channels count: %i", frame.channels ); FlushBuffer( p_sys, frame.bytesconsumed ); date_Set( &p_sys->date, VLC_TS_INVALID ); + p_sys->b_discontinuity = true; return VLCDEC_SUCCESS; } @@ -508,6 +511,12 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block ) FlushBuffer( p_sys, frame.bytesconsumed ); + if( p_sys->b_discontinuity ) + { + p_out->i_flags |= BLOCK_FLAG_DISCONTINUITY; + p_sys->b_discontinuity = false; + } + decoder_QueueAudio( p_dec, p_out ); return VLCDEC_SUCCESS; } -- GitLab