[vlc-commits] codec: faad: signal discontinuity to aout
Francois Cartegnie
git at videolan.org
Thu Feb 23 20:51:27 CET 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb 23 19:14:42 2017 +0100| [ebdd78ef3e45219cc96cd2afc59eb76571f9d36e] | committer: Francois Cartegnie
codec: faad: signal discontinuity to aout
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ebdd78ef3e45219cc96cd2afc59eb76571f9d36e
---
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 64a1a73..adb5069 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;
}
More information about the vlc-commits
mailing list