From: 汪亚强 <[email protected]>

When parsing a block, the passed data corresponds to the pos value.
However, when constructing a packet, some offsets are made to the data,
so the pos in the packet does not correspond to the position in the file.

Signed-off-by: 汪亚强 <[email protected]>
---
 libavformat/matroskadec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 503b99b286..0215855019 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -4116,7 +4116,7 @@ static int matroska_parse_block(MatroskaDemuxContext 
*matroska, AVBufferRef *buf
     int n, flags, laces = 0;
     uint64_t num;
     int trust_default_duration;
-
+    uint8_t *data_start = data;
     av_assert1(buf);
 
     ffio_init_read_context(&pb, data, size);
@@ -4200,7 +4200,7 @@ static int matroska_parse_block(MatroskaDemuxContext 
*matroska, AVBufferRef *buf
     if (cluster_time != (uint64_t)-1 && (block_time >= 0 || cluster_time >= 
-block_time))
         track->end_timecode =
             FFMAX(track->end_timecode, timecode + block_duration);
-
+    pos += (data - data_start);
     for (n = 0; n < laces; n++) {
         int64_t lace_duration = block_duration*(n+1) / laces - 
block_duration*n / laces;
         uint8_t *out_data = data;
-- 
2.50.1 (Apple Git-155)

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to