PR #25730 opened by DeVshaurya01
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25730
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25730.patch

The first two entries were added with timestamp i instead of i << seekd, so 
seeks that pick entry 1 mislabel the packets; on inside-mp8.mpc ffmpeg -ss 3.4 
skips 1.67 s of audio.

Signed-off-by: Shaurya Atram <[email protected]>

# Summary of changes

Briefly describe what this PR does and why.

<!--
If this PR requires new FATE test samples, attach them to the PR and
list their target paths below (relative to the fate-suite root).

Attached filenames must match the sample's filename:

```fate-samples
# e.g. vorbis/new-sample.ogg
```
-->



>From 3e1e423168b338de71dcb2baff3f0ee245f661f0 Mon Sep 17 00:00:00 2001
From: Shaurya Atram <[email protected]>
Date: Tue, 3 Nov 2026 15:19:15 +0000
Subject: [PATCH] avformat/mpc8: fix timestamp of the second seek table entry

The first two entries were added with timestamp i instead of i << seekd, so 
seeks that pick entry 1 mislabel the packets; on inside-mp8.mpc ffmpeg -ss 3.4 
skips 1.67 s of audio.

Signed-off-by: Shaurya Atram <[email protected]>
---
 libavformat/mpc8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 1540524c1f6..d0d3f1c4508 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -190,7 +190,7 @@ static int mpc8_parse_seektable(AVFormatContext *s, int64_t 
off)
 
         pos += c->header_pos;
         ppos[1 - i] = pos;
-        av_add_index_entry(s->streams[0], pos, i, 0, 0, AVINDEX_KEYFRAME);
+        av_add_index_entry(s->streams[0], pos, (int64_t)i << seekd, 0, 0, 
AVINDEX_KEYFRAME);
     }
     for(; i < size; i++){
         if (get_bits_left(&gb) < 13) {
-- 
2.54.0

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

Reply via email to