Commit ebdd78ef authored by François Cartegnie's avatar François Cartegnie 🤞

codec: faad: signal discontinuity to aout

parent 3e7e6c28
...@@ -79,7 +79,7 @@ struct decoder_sys_t ...@@ -79,7 +79,7 @@ struct decoder_sys_t
/* Channel positions of the current stream (for re-ordering) */ /* Channel positions of the current stream (for re-ordering) */
uint32_t pi_channel_positions[MAX_CHANNEL_POSITIONS]; 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] = static const uint32_t pi_channels_in[MAX_CHANNEL_POSITIONS] =
...@@ -190,6 +190,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -190,6 +190,7 @@ static int Open( vlc_object_t *p_this )
/* buffer */ /* buffer */
p_sys->p_block = NULL; p_sys->p_block = NULL;
p_sys->b_discontinuity =
p_sys->b_sbr = p_sys->b_ps = false; p_sys->b_sbr = p_sys->b_ps = false;
p_dec->pf_decode = DecodeBlock; p_dec->pf_decode = DecodeBlock;
...@@ -402,6 +403,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block ) ...@@ -402,6 +403,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
} }
Flush( p_dec ); Flush( p_dec );
p_sys->b_discontinuity = true;
return VLCDEC_SUCCESS; return VLCDEC_SUCCESS;
} }
...@@ -411,6 +413,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block ) ...@@ -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 ); msg_Warn( p_dec, "invalid channels count: %i", frame.channels );
FlushBuffer( p_sys, frame.bytesconsumed ); FlushBuffer( p_sys, frame.bytesconsumed );
date_Set( &p_sys->date, VLC_TS_INVALID ); date_Set( &p_sys->date, VLC_TS_INVALID );
p_sys->b_discontinuity = true;
return VLCDEC_SUCCESS; return VLCDEC_SUCCESS;
} }
...@@ -508,6 +511,12 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block ) ...@@ -508,6 +511,12 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
FlushBuffer( p_sys, frame.bytesconsumed ); 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 ); decoder_QueueAudio( p_dec, p_out );
return VLCDEC_SUCCESS; return VLCDEC_SUCCESS;
} }
......
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