Commit ff9139a5 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: mp4: set pts delay = preload

parent 7604cc29
...@@ -1612,11 +1612,24 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -1612,11 +1612,24 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_EGENERIC; return VLC_EGENERIC;
return Seek( p_demux, p_sys->p_title->seekpoint[i_seekpoint]->i_time_offset ); return Seek( p_demux, p_sys->p_title->seekpoint[i_seekpoint]->i_time_offset );
} }
case DEMUX_GET_PTS_DELAY:
{
for( unsigned int i = 0; i < p_sys->i_tracks; i++ )
{
const MP4_Box_t *p_load;
if ( (p_load = MP4_BoxGet( p_sys->track[i].p_track, "load" )) &&
BOXDATA(p_load)->i_duration > 0 )
{
*va_arg(args, int64_t *) = BOXDATA(p_load)->i_duration *
CLOCK_FREQ / p_sys->track[i].i_timescale;
return VLC_SUCCESS;
}
}
return VLC_EGENERIC;
}
case DEMUX_SET_NEXT_DEMUX_TIME: case DEMUX_SET_NEXT_DEMUX_TIME:
case DEMUX_SET_GROUP: case DEMUX_SET_GROUP:
case DEMUX_HAS_UNSUPPORTED_META: case DEMUX_HAS_UNSUPPORTED_META:
case DEMUX_GET_PTS_DELAY:
case DEMUX_CAN_RECORD: case DEMUX_CAN_RECORD:
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -2540,6 +2553,8 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track, ...@@ -2540,6 +2553,8 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
{ {
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
p_track->p_track = p_box_trak;
MP4_Box_t *p_tkhd = MP4_BoxGet( p_box_trak, "tkhd" ); MP4_Box_t *p_tkhd = MP4_BoxGet( p_box_trak, "tkhd" );
MP4_Box_t *p_tref = MP4_BoxGet( p_box_trak, "tref" ); MP4_Box_t *p_tref = MP4_BoxGet( p_box_trak, "tref" );
MP4_Box_t *p_elst; MP4_Box_t *p_elst;
......
...@@ -115,6 +115,7 @@ typedef struct ...@@ -115,6 +115,7 @@ typedef struct
uint64_t i_first_dts; /* i_first_dts value uint64_t i_first_dts; /* i_first_dts value
of the next chunk */ of the next chunk */
MP4_Box_t *p_track;
MP4_Box_t *p_stbl; /* will contain all timing information */ MP4_Box_t *p_stbl; /* will contain all timing information */
MP4_Box_t *p_stsd; /* will contain all data to initialize decoder */ MP4_Box_t *p_stsd; /* will contain all data to initialize decoder */
MP4_Box_t *p_sample;/* point on actual sdsd */ MP4_Box_t *p_sample;/* point on actual sdsd */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment