[vlc-commits] demux: mp4: add adaptative smooth hotfix
Francois Cartegnie
git at videolan.org
Tue Oct 27 19:13:53 CET 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Oct 23 19:09:00 2015 +0200| [8b269f94fa95a1d374140fef3a8f3fd33422bddd] | committer: Francois Cartegnie
demux: mp4: add adaptative smooth hotfix
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8b269f94fa95a1d374140fef3a8f3fd33422bddd
---
modules/demux/mp4/mp4.c | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 4378162..033257f 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -83,7 +83,8 @@ struct demux_sys_t
bool b_seekable;
bool b_fastseekable;
bool b_seekmode;
- bool b_smooth; /* Is it Smooth Streaming? */
+ bool b_smooth; /* Is it Smooth Streaming? (streamfilter) */
+ bool b_ismv;
bool b_index_probed;
bool b_fragments_probed;
@@ -649,6 +650,11 @@ static int Open( vlc_object_t * p_this )
{
msg_Dbg( p_demux, "DASH Stream" );
}
+ else if (BOXDATA(p_ftyp)->i_compatible_brands[i] == VLC_FOURCC('s', 'm', 'o', 'o') )
+ {
+ msg_Dbg( p_demux, "Handling VLC Smooth Stream" );
+ p_sys->b_ismv = true;
+ }
}
}
else
@@ -4250,6 +4256,18 @@ static bool AddFragment( demux_t *p_demux, MP4_Box_t *p_moox )
i_track_defaultsamplesize = 1;
i_track_defaultsampleduration = 1;
}
+ else if( p_sys->b_ismv && p_sys->i_tracks == 1 )
+ {
+ const MP4_Box_t *p_trex = MP4_BoxGet( p_moovfragment->p_moox, "mvex/trex" );
+ if ( p_trex )
+ {
+ i_track_defaultsamplesize = BOXDATA(p_trex)->i_default_sample_size;
+ i_track_defaultsampleduration = BOXDATA(p_trex)->i_default_sample_duration;
+ }
+ const MP4_Box_t *p_mdhd = MP4_BoxGet( p_moovfragment->p_moox, "trak/mdia/mdhd" );
+ if ( p_mdhd )
+ i_track_timescale = BOXDATA(p_mdhd)->i_timescale;
+ }
else
{
/* set trex for defaults */
@@ -5141,6 +5159,14 @@ static int DemuxAsLeaf( demux_t *p_demux )
return 1;
}
+ /* Hotfix for adaptive/smooth streaming as we don't know track # when creating moov */
+ if( p_fragbox->i_type == ATOM_moof && p_sys->b_ismv && p_sys->i_tracks == 1 )
+ {
+ MP4_Box_t *p_tfhd = MP4_BoxGet( p_fragbox, "traf/tfhd" );
+ if(p_tfhd && BOXDATA(p_tfhd))
+ p_sys->track[0].i_track_ID = BOXDATA(p_tfhd)->i_track_ID;
+ }
+
MP4_Box_t *p_mfhd = MP4_BoxGet( p_fragbox, "mfhd" );
if( p_mfhd && BOXDATA(p_mfhd) )
{
More information about the vlc-commits
mailing list