changeset 1911:2ce053f3d996 libavformat

move timecode calculation out of laces loop
author aurel
date Mon, 12 Mar 2007 21:58:29 +0000
parents 01db389826cb
children 98a74cfd12d4
files matroska.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/matroska.c	Mon Mar 12 17:43:36 2007 +0000
+++ b/matroska.c	Mon Mar 12 21:58:29 2007 +0000
@@ -2552,18 +2552,18 @@
 
     if (res == 0) {
         int real_v = matroska->tracks[track]->flags & MATROSKA_TRACK_REAL_V;
+        uint64_t timecode = AV_NOPTS_VALUE;
+
+        if (cluster_time != (uint64_t)-1 && cluster_time + block_time >= 0)
+            timecode = cluster_time + block_time;
+
         for (n = 0; n < laces; n++) {
-            uint64_t timecode = AV_NOPTS_VALUE;
             int slice, slices = 1;
 
             if (real_v) {
                 slices = *data++ + 1;
                 lace_size[n]--;
             }
-            if (cluster_time != (uint64_t)-1 && n == 0) {
-                if (cluster_time + block_time >= 0)
-                    timecode = cluster_time + block_time;
-            }
             /* FIXME: duration */
 
             for (slice=0; slice<slices; slice++) {
@@ -2595,6 +2595,8 @@
                     matroska_queue_packet_reordered(matroska, pkt, is_bframe);
                 else
                     matroska_queue_packet(matroska, pkt);
+
+                timecode = AV_NOPTS_VALUE;
             }
             data += lace_size[n];
         }