aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-03-25 19:51:12 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-03-25 19:51:12 +0000
commitd766800b78a10385c97aff02ef46c19040a2955f (patch)
treeabbc0e05a192b044ba64ca3429a443aea1770209
parent78a11456a1d45cf416750322de7b2325ded4188e (diff)
downloadffmpeg-d766800b78a10385c97aff02ef46c19040a2955f.tar.gz
dont set random timestamps if they are not known
Originally committed as revision 5219 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/matroska.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index 252c47ba5e..b7e3a711e3 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -2417,7 +2417,7 @@ matroska_parse_blockgroup (MatroskaDemuxContext *matroska,
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 @@ matroska_parse_blockgroup (MatroskaDemuxContext *matroska,
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 */