changeset 1036:e0b7705c2e42 libavformat

dont set random timestamps if they are not known
author michael
date Sat, 25 Mar 2006 19:51:12 +0000
parents 4a33428641e1
children aa2712de50bf
files matroska.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/matroska.c	Sat Mar 25 19:40:27 2006 +0000
+++ b/matroska.c	Sat Mar 25 19:51:12 2006 +0000
@@ -2417,7 +2417,7 @@
 
                 if (res == 0) {
                     for (n = 0; n < laces; n++) {
-                        uint64_t timecode = 0;
+                        uint64_t timecode = AV_NOPTS_VALUE;
 
                         pkt = av_mallocz(sizeof(AVPacket));
                         /* XXX: prevent data copy... */
@@ -2425,10 +2425,8 @@
                             res = AVERROR_NOMEM;
                             break;
                         }
-                        if (cluster_time != (uint64_t)-1) {
-                            if (block_time < 0 && (-block_time) > cluster_time)
-                                timecode = cluster_time;
-                            else
+                        if (cluster_time != (uint64_t)-1 && n == 0) {
+                            if (cluster_time + block_time >= 0)
                                 timecode = cluster_time + block_time;
                         }
                         /* FIXME: duration */