# HG changeset patch # User michael # Date 1143316272 0 # Node ID e0b7705c2e42218b94a85116e8a5218db2e38969 # Parent 4a33428641e168c15ea8dfc10d520fcad4afecab dont set random timestamps if they are not known diff -r 4a33428641e1 -r e0b7705c2e42 matroska.c --- 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 */