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

Git pushed a commit to branch master
in repository ffmpeg.

commit 68b53a8dbfdfbcce72d5b676edfcddb2f5d7a070
Author:     James Almer <[email protected]>
AuthorDate: Wed Jun 10 18:19:09 2026 -0300
Commit:     James Almer <[email protected]>
CommitDate: Tue Jun 16 09:18:23 2026 -0300

    avformat/demux: discard trimming samples in codecs with fixed frame size
    
    When a demuxer reports the last packet with a duration smaller than the 
real coded duration,
    this information is not relayed to the decoder, which will happily output 
all the trimming
    samples anyway.
    Fix that by ensuring we export a discard padding information as side data.
    
    Signed-off-by: James Almer <[email protected]>
---
 libavformat/demux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/demux.c b/libavformat/demux.c
index 55085210de..516f286e19 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -1536,7 +1536,7 @@ static int read_frame_internal(AVFormatContext *s, 
AVPacket *pkt)
         if (sti->first_discard_sample && pkt->pts != AV_NOPTS_VALUE) {
             int64_t pts = pkt->pts - (is_relative(pkt->pts) ? RELATIVE_TS_BASE 
: 0);
             int64_t sample = ts_to_samples(st, pts);
-            int64_t duration = ts_to_samples(st, pkt->duration);
+            int64_t duration = FFMAX(st->codecpar->frame_size, 
ts_to_samples(st, pkt->duration));
             int64_t end_sample = sample + duration;
             if (duration > 0 && end_sample >= sti->first_discard_sample &&
                 sample < sti->last_discard_sample)

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

Reply via email to