[vlc-commits] packetizer: flac: return a block even with invalid pts
Thomas Guillem
git at videolan.org
Fri Oct 25 16:26:11 CEST 2019
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Oct 25 13:58:31 2019 +0200| [706375b630dd14a4bd0f22b857590b397ab7fb36] | committer: Francois Cartegnie
packetizer: flac: return a block even with invalid pts
The flac demuxer is waiting for a valid block from GetPacketizedBlock() and
will set the pts via FLAC_ParseSyncInfo().
There was a chicken-egg situation when both the demuxer and the packetizer were
waiting each other for a valid pts after a seek.
Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=706375b630dd14a4bd0f22b857590b397ab7fb36
---
modules/packetizer/flac.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/modules/packetizer/flac.c b/modules/packetizer/flac.c
index 8e98ecc690..5218fcb661 100644
--- a/modules/packetizer/flac.c
+++ b/modules/packetizer/flac.c
@@ -517,20 +517,18 @@ static block_t *Packetize(decoder_t *p_dec, block_t **pp_block)
p_sys->bytestream.p_block->i_pts = VLC_TS_INVALID;
}
- if( date_Get( &p_sys->pts ) > VLC_TS_INVALID )
+ out = block_heap_Alloc( p_sys->p_buf, p_sys->i_frame_size );
+ if( out )
{
- out = block_heap_Alloc( p_sys->p_buf, p_sys->i_frame_size );
- if( out )
- {
- out->i_dts = out->i_pts = date_Get( &p_sys->pts );
- out->i_flags = p_sys->i_next_block_flags;
- p_sys->i_next_block_flags = 0;
- }
- else
- p_sys->p_buf = NULL;
-
- date_Increment( &p_sys->pts, p_sys->headerinfo.i_frame_length );
+ out->i_dts = out->i_pts = date_Get( &p_sys->pts );
+ out->i_flags = p_sys->i_next_block_flags;
+ p_sys->i_next_block_flags = 0;
+ if( out->i_pts != VLC_TS_INVALID )
+ date_Increment( &p_sys->pts, p_sys->headerinfo.i_frame_length );
}
+ else
+ p_sys->p_buf = NULL;
+
if( out )
out->i_length = date_Get( &p_sys->pts ) - out->i_pts;
More information about the vlc-commits
mailing list