[vlc-devel] commit: avformat: set the "duration/length/ of a packet if known. ( Derk-Jan Hartman )

git version control git at videolan.org
Thu Sep 18 16:32:56 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Thu Sep 18 16:35:44 2008 +0200| [542d6d28ce1a3f0b8be56ce988598e1662dbe7bf] | committer: Derk-Jan Hartman 

avformat: set the "duration/length/ of a packet if known.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=542d6d28ce1a3f0b8be56ce988598e1662dbe7bf
---

 modules/demux/avformat/demux.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 84d8bb9..683c184 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,




More information about the vlc-devel mailing list