changeset 3267:37e245554350 libavformat

set pkt duration, only when dts == pts though, patch by Henrik Gulbrandsen henrik at gulbra dot net
author bcoudurier
date Sat, 26 Apr 2008 17:51:02 +0000
parents ef617b3c568d
children 319c36da904b
files mov.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Sat Apr 26 06:29:56 2008 +0000
+++ b/mov.c	Sat Apr 26 17:51:02 2008 +0000
@@ -1812,6 +1812,10 @@
             sc->sample_to_ctime_sample = 0;
         }
     } else {
+        AVStream *st = s->streams[sc->ffindex];
+        int64_t next_dts = (sc->current_sample < sc->sample_count) ?
+            st->index_entries[sc->current_sample].timestamp : st->duration;
+        pkt->duration = next_dts - pkt->dts;
         pkt->pts = pkt->dts;
     }
     pkt->flags |= sample->flags & AVINDEX_KEYFRAME ? PKT_FLAG_KEY : 0;