[vlc-commits] packetizer: mpeg4audio: fix discontinuity check
vlc/vlc-3.0 | branch: master | Francois Cartegnie | Tue Jun 12 18:16:11 2018 +0200| [241b31178ea078cd22803369b2adaf15831fcf8a] | committer: Francois Cartegnie packetizer: mpeg4audio: fix discontinuity check triggering discontinuity on every packet with some streams, depending on preroll (cherry picked from commit 5daf4fe95f1d8d5cbc523dd763cf6f9405327bd1) > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=241b31178ea078cd22803369b2adaf15831fcf8a --- modules/packetizer/mpeg4audio.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/packetizer/mpeg4audio.c b/modules/packetizer/mpeg4audio.c index eb39e70eb3..b3a12ab2e9 100644 --- a/modules/packetizer/mpeg4audio.c +++ b/modules/packetizer/mpeg4audio.c @@ -329,11 +329,12 @@ static block_t *ForwardRawBlock(decoder_t *p_dec, block_t **pp_block) p_block = *pp_block; *pp_block = NULL; /* Don't reuse this block */ +int64_t i_diff = 0; if (p_block->i_pts > VLC_TS_INVALID && p_block->i_pts != date_Get(_sys->end_date)) { if(date_Get(_sys->end_date) > VLC_TS_INVALID) -p_sys->b_discontuinity = true; +i_diff = llabs( date_Get(_sys->end_date) - p_block->i_pts ); date_Set(_sys->end_date, p_block->i_pts); } @@ -341,10 +342,15 @@ static block_t *ForwardRawBlock(decoder_t *p_dec, block_t **pp_block) /* Might not be known due to missing extradata, will be set to block pts above */ -if(p_dec->fmt_out.audio.i_frame_length) +if(p_dec->fmt_out.audio.i_frame_length && p_block->i_pts != VLC_TS_INVALID) +{ p_block->i_length = date_Increment(_sys->end_date, p_dec->fmt_out.audio.i_frame_length) - p_block->i_pts; +if( i_diff > p_block->i_length ) +p_sys->b_discontuinity = true; +} + return p_block; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits
[vlc-commits] packetizer: mpeg4audio: fix discontinuity check
vlc | branch: master | Francois Cartegnie | Tue Jun 12 18:16:11 2018 +0200| [5daf4fe95f1d8d5cbc523dd763cf6f9405327bd1] | committer: Francois Cartegnie packetizer: mpeg4audio: fix discontinuity check triggering discontinuity on every packet with some streams, depending on preroll > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5daf4fe95f1d8d5cbc523dd763cf6f9405327bd1 --- modules/packetizer/mpeg4audio.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/packetizer/mpeg4audio.c b/modules/packetizer/mpeg4audio.c index 9237853a3e..9f5fe4532b 100644 --- a/modules/packetizer/mpeg4audio.c +++ b/modules/packetizer/mpeg4audio.c @@ -329,11 +329,12 @@ static block_t *ForwardRawBlock(decoder_t *p_dec, block_t **pp_block) p_block = *pp_block; *pp_block = NULL; /* Don't reuse this block */ +int64_t i_diff = 0; if (p_block->i_pts != VLC_TS_INVALID && p_block->i_pts != date_Get(_sys->end_date)) { if(date_Get(_sys->end_date) != VLC_TS_INVALID) -p_sys->b_discontuinity = true; +i_diff = llabs( date_Get(_sys->end_date) - p_block->i_pts ); date_Set(_sys->end_date, p_block->i_pts); } @@ -341,10 +342,15 @@ static block_t *ForwardRawBlock(decoder_t *p_dec, block_t **pp_block) /* Might not be known due to missing extradata, will be set to block pts above */ -if(p_dec->fmt_out.audio.i_frame_length) +if(p_dec->fmt_out.audio.i_frame_length && p_block->i_pts != VLC_TS_INVALID) +{ p_block->i_length = date_Increment(_sys->end_date, p_dec->fmt_out.audio.i_frame_length) - p_block->i_pts; +if( i_diff > p_block->i_length ) +p_sys->b_discontuinity = true; +} + return p_block; } ___ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits