This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new c69954c345 avformat/rmdec: reset audio deinterleave state on seek
c69954c345 is described below

commit c69954c34522c53234dfd43fa7a0cb3b02f39e47
Author:     yefei5 <[email protected]>
AuthorDate: Thu Oct 8 11:27:29 2026 +0800
Commit:     Peter Ross <[email protected]>
CommitDate: Wed Oct 28 04:40:17 2026 +0000

    avformat/rmdec: reset audio deinterleave state on seek
    
    rm_read_seek() clears rm->audio_pkt_cnt but leaves the per-stream
    ast->sub_packet_cnt and ast->audiotimestamp untouched. For the
    interleaved deinterleavers (GENR / INT4 / SIPR) a stale sub_packet_cnt
    makes the next block complete after only (h - sub_packet_cnt) new rm
    packets, so it keeps pre-seek payload in the remaining descramble slots
    and loses its container timestamp.
    
    519ebb5ee5 added rm_read_seek() for the same problem (ticket #1605) but
    only reset the output counter, not the assembly progress.
    
    Signed-off-by: yefei5 <[email protected]>
---
 libavformat/rmdec.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 4a8e2f08df..4009048981 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -1160,10 +1160,25 @@ static int rm_read_seek(AVFormatContext *s, int 
stream_index,
                         int64_t pts, int flags)
 {
     RMDemuxContext *rm = s->priv_data;
+    unsigned int i;
 
     if (ff_seek_frame_binary(s, stream_index, pts, flags) < 0)
         return -1;
     rm->audio_pkt_cnt = 0;
+
+    /* A stale sub_packet_cnt makes the first interleave block after the
+     * seek reuse pre-seek payload in the remaining descramble slots and
+     * lose its container timestamp, which also shifts all following
+     * block boundaries. */
+    for (i = 0; i < s->nb_streams; i++) {
+        AVStream *st  = s->streams[i];
+        RMStream *ast = st->priv_data;
+
+        if (ast && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
+            ast->sub_packet_cnt = 0;
+            ast->audiotimestamp = AV_NOPTS_VALUE;
+        }
+    }
     return 0;
 }
 

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to