[vlc-commits] demux: mp4: demux multiple asf packets
Francois Cartegnie
git at videolan.org
Tue Nov 17 13:13:39 CET 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 5 17:31:22 2020 +0100| [e0516df7b61de113c22713e514b08458c7535454] | committer: Francois Cartegnie
demux: mp4: demux multiple asf packets
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e0516df7b61de113c22713e514b08458c7535454
---
modules/demux/mp4/mp4.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index e908c678cd..f0b55cc2b1 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -717,9 +717,17 @@ static void MP4_Block_Send( demux_t *p_demux, mp4_track_t *p_track, block_t *p_b
p_track->i_dts_backup = p_block->i_dts;
p_track->i_pts_backup = p_block->i_pts;
/* And demux it as ASF packet */
- DemuxASFPacket( &p_sys->asfpacketsys, p_block->i_buffer, p_block->i_buffer,
- 0, p_block->i_buffer );
- vlc_stream_Delete( p_sys->asfpacketsys.s );
+ uint64_t startpos;
+ do
+ {
+ startpos = vlc_stream_Tell(p_sys->asfpacketsys.s);
+ DemuxASFPacket( &p_sys->asfpacketsys,
+ p_block->i_buffer - startpos,
+ p_block->i_buffer - startpos,
+ 0, p_block->i_buffer );
+ } while( vlc_stream_Tell(p_sys->asfpacketsys.s) != p_block->i_buffer &&
+ vlc_stream_Tell(p_sys->asfpacketsys.s) != startpos );
+ vlc_stream_Delete(p_sys->asfpacketsys.s);
}
block_Release(p_block);
}
@@ -1170,7 +1178,7 @@ static int Open( vlc_object_t * p_this )
p_sys->asfpacketsys.pi_preroll = &p_sys->i_preroll;
p_sys->asfpacketsys.pi_preroll_start = &p_sys->i_preroll_start;
p_sys->asfpacketsys.b_deduplicate = true;
- p_sys->asfpacketsys.b_can_hold_multiple_packets = false;
+ p_sys->asfpacketsys.b_can_hold_multiple_packets = true;
p_sys->asfpacketsys.pf_doskip = NULL;
p_sys->asfpacketsys.pf_send = MP4ASF_Send;
p_sys->asfpacketsys.pf_gettrackinfo = MP4ASF_GetTrackInfo;
More information about the vlc-commits
mailing list