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 d69e8d0a95 avcodec/decode: reset PTS correction counters in 
ff_decode_flush_buffers
d69e8d0a95 is described below

commit d69e8d0a955c0248052619b9c05fa3dc7ce49986
Author:     Bogdan Lisman <[email protected]>
AuthorDate: Mon Jun 15 01:15:57 2026 +0300
Commit:     James Almer <[email protected]>
CommitDate: Tue Jun 16 15:59:52 2026 +0000

    avcodec/decode: reset PTS correction counters in ff_decode_flush_buffers
    
    pts_correction_num_faulty_pts and pts_correction_num_faulty_dts were not
    cleared by ff_decode_flush_buffers(), so they survived 
avcodec_flush_buffers().
    After a seek, guess_correct_pts() therefore kept biasing its reordered-pts 
vs
    dts choice on pre-seek history instead of starting fresh as it does after
    ff_decode_preinit(), which already zeroes both counters. This could yield an
    incorrect AVFrame.best_effort_timestamp on the frames following a seek.
    
    Reset both counters on flush, next to the existing last_pts/last_dts reset, 
so
    the decoder's timestamp-correction state is fully reinitialized.
    
    Fixes: ticket #11645
    Reported-by: keks51
    Signed-off-by: Bogdan Lisman <[email protected]>
---
 libavcodec/decode.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 8702e04086..6f85e5f514 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -2364,6 +2364,8 @@ av_cold void ff_decode_flush_buffers(AVCodecContext 
*avctx)
     av_packet_unref(avci->last_pkt_props);
     av_packet_unref(avci->in_pkt);
 
+    dc->pts_correction_num_faulty_pts =
+    dc->pts_correction_num_faulty_dts = 0;
     dc->pts_correction_last_pts =
     dc->pts_correction_last_dts = INT64_MIN;
 

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

Reply via email to