[vlc-commits] demux: mp4: fix double duration with fragmented
Francois Cartegnie
git at videolan.org
Thu Feb 25 23:00:44 CET 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Feb 22 13:27:37 2016 +0100| [30c32ef935f2afb989e77a9c11de3c5ad59e42aa] | committer: Francois Cartegnie
demux: mp4: fix double duration with fragmented
Happens with duration on tkhd but empty moov
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=30c32ef935f2afb989e77a9c11de3c5ad59e42aa
---
modules/demux/mp4/mp4.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 3175ed3..3beabf5 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3836,7 +3836,11 @@ static bool AddFragment( demux_t *p_demux, MP4_Box_t *p_moox )
i_trakcount = 0;
while( p_trak )
{
- if ( p_trak->i_type == ATOM_trak && (p_tkhd = MP4_BoxGet( p_trak, "tkhd" )) )
+ const MP4_Box_t *p_stsz;
+ if ( p_trak->i_type == ATOM_trak &&
+ (p_tkhd = MP4_BoxGet( p_trak, "tkhd" )) &&
+ (p_stsz = MP4_BoxGet( p_trak, "mdia/minf/stbl/stsz" )) &&
+ BOXDATA(p_stsz)->i_sample_count > 0 )
{
p_moovfragment->p_durations[i_trakcount].i_duration = BOXDATA(p_tkhd)->i_duration;
p_moovfragment->p_durations[i_trakcount++].i_track_ID = BOXDATA(p_tkhd)->i_track_ID;
More information about the vlc-commits
mailing list