OSDN Git Service

set pkt->duration for laced packets too
authorAurelien Jacobs <aurel@gnuage.org>
Tue, 13 Mar 2007 00:16:31 +0000 (00:16 +0000)
committerAurelien Jacobs <aurel@gnuage.org>
Tue, 13 Mar 2007 00:16:31 +0000 (00:16 +0000)
Originally committed as revision 8366 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/matroska.c

index 548e84e..8523227 100644 (file)
@@ -2593,6 +2593,7 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
 
                 pkt->pts = timecode;
                 pkt->pos = pos;
+                pkt->duration = duration;
 
                 if (matroska->tracks[track]->flags & MATROSKA_TRACK_REORDER)
                     matroska_queue_packet_reordered(matroska, pkt, is_bframe);
@@ -2692,14 +2693,6 @@ matroska_parse_blockgroup (MatroskaDemuxContext *matroska,
                                    duration, is_keyframe, is_bframe,
                                    &track, &pkt);
 
-    if (pkt)
-    {
-        if (duration != AV_NOPTS_VALUE)
-            pkt->duration = duration;
-        else if (track >= 0 && track < matroska->num_tracks)
-            pkt->duration = matroska->tracks[track]->default_duration;
-    }
-
     return res;
 }