* [FFmpeg-devel] [PATCH] libavformat/matroskadec: fix the pos value error in the packet
@ 2026-02-26 12:44 wangyaqiang via ffmpeg-devel
2026-02-26 12:55 ` [FFmpeg-devel] " Patchwork via ffmpeg-devel
0 siblings, 1 reply; 2+ messages in thread
From: wangyaqiang via ffmpeg-devel @ 2026-02-26 12:44 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: 汪亚强, 1035567130
From: 汪亚强 <wangyaqiang03@kuaishou.com>
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: 汪亚强 <wangyaqiang03@kuaishou.com>
---
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 -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] 2+ messages in thread
* [FFmpeg-devel] Re: [PATCH] libavformat/matroskadec: fix the pos value error in the packet
2026-02-26 12:44 [FFmpeg-devel] [PATCH] libavformat/matroskadec: fix the pos value error in the packet wangyaqiang via ffmpeg-devel
@ 2026-02-26 12:55 ` Patchwork via ffmpeg-devel
0 siblings, 0 replies; 2+ messages in thread
From: Patchwork via ffmpeg-devel @ 2026-02-26 12:55 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: yinshiyou-hf, Patchwork
Hello,
Thank you for submitting a patch to ffmpeg-devel.
An error occurred during an automated build/fate test. Please review the following link for more details:
https://patchwork.ffmpeg.org/project/ffmpeg/patch/tencent_8009C428CE559D0F6D0831195645ED71EB05@qq.com/
Thank you,
ffmpeg-devel
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-26 12:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-26 12:44 [FFmpeg-devel] [PATCH] libavformat/matroskadec: fix the pos value error in the packet wangyaqiang via ffmpeg-devel
2026-02-26 12:55 ` [FFmpeg-devel] " Patchwork via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git