From: Derk-Jan Hartman Date: Thu, 18 Sep 2008 14:35:44 +0000 (+0200) Subject: avformat: set the "duration/length/ of a packet if known. X-Git-Tag: 1.0.0-pre1~3163 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=542d6d28ce1a3f0b8be56ce988598e1662dbe7bf;p=vlc avformat: set the "duration/length/ of a packet if known. --- diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c index 84d8bb914c..683c184ef3 100644 --- a/modules/demux/avformat/demux.c +++ b/modules/demux/avformat/demux.c @@ -377,6 +377,10 @@ static int Demux( demux_t *p_demux ) 0 : (pkt.pts) * 1000000 * p_sys->ic->streams[pkt.stream_index]->time_base.num / p_sys->ic->streams[pkt.stream_index]->time_base.den - i_start_time; + if( pkt.duration > 0 ) + p_frame->i_length = pkt.duration * 1000000 * + p_sys->ic->streams[pkt.stream_index]->time_base.num / + p_sys->ic->streams[pkt.stream_index]->time_base.den - i_start_time; #ifdef AVFORMAT_DEBUG msg_Dbg( p_demux, "tk[%d] dts=%"PRId64" pts=%"PRId64,