[vlc-commits] packetizer: mpegaudio: flag discontinuity on timebase change
Francois Cartegnie
git at videolan.org
Wed Oct 26 19:07:02 CEST 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct 25 11:22:58 2016 +0200| [ce02dd5c0defc8f15b93f8b6c6b986cfaadfa50e] | committer: Francois Cartegnie
packetizer: mpegaudio: flag discontinuity on timebase change
also resets internal timebase on backward seek
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ce02dd5c0defc8f15b93f8b6c6b986cfaadfa50e
---
modules/packetizer/mpegaudio.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/modules/packetizer/mpegaudio.c b/modules/packetizer/mpegaudio.c
index 6cab0f5..1f7ad0f 100644
--- a/modules/packetizer/mpegaudio.c
+++ b/modules/packetizer/mpegaudio.c
@@ -345,10 +345,18 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
case STATE_SYNC:
/* New frame, set the Presentation Time Stamp */
p_sys->i_pts = p_sys->bytestream.p_block->i_pts;
- if( p_sys->i_pts > VLC_TS_INVALID &&
- p_sys->i_pts > date_Get( &p_sys->end_date ) )
+ if( p_sys->i_pts > VLC_TS_INVALID )
{
- date_Set( &p_sys->end_date, p_sys->i_pts );
+ /* start or discontinuity */
+ if( date_Get( &p_sys->end_date ) == 0 )
+ {
+ date_Set( &p_sys->end_date, p_sys->i_pts );
+ }
+ else if( date_Get( &p_sys->end_date ) != p_sys->i_pts )
+ {
+ date_Set( &p_sys->end_date, p_sys->i_pts );
+ p_sys->b_discontinuity = true;
+ }
}
p_sys->i_state = STATE_HEADER;
More information about the vlc-commits
mailing list