From 916bf03a699e7ca681df994c2bc8330a087c8b0c Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Mon, 12 Mar 2007 21:58:29 +0000 Subject: [PATCH] move timecode calculation out of laces loop Originally committed as revision 8359 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/matroska.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libavformat/matroska.c b/libavformat/matroska.c index bd34e81493..717d878a0e 100644 --- a/libavformat/matroska.c +++ b/libavformat/matroska.c @@ -2552,18 +2552,18 @@ matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, 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