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

Git pushed a commit to branch master
in repository ffmpeg.

commit b613eebe78de519a5b5bd1fd3a82641dc77dffbc
Author:     James Almer <[email protected]>
AuthorDate: Sun Feb 1 00:43:15 2026 -0300
Commit:     James Almer <[email protected]>
CommitDate: Mon Feb 2 12:52:02 2026 -0300

    avformat/demux: don't overwrite packet durations with parser ones if unset
    
    Prevents loss of values taken from the demuxer when the underlying parser
    doesn't set durations.
    
    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 06cb8d0c54..c68334e1ab 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -1265,7 +1265,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
         /* set the duration */
         out_pkt->duration = (sti->parser->flags & PARSER_FLAG_COMPLETE_FRAMES) 
? pkt->duration : 0;
         if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
-            if (sti->avctx->sample_rate > 0) {
+            if (sti->avctx->sample_rate > 0 && sti->parser->duration > 0) {
                 out_pkt->duration =
                     av_rescale_q_rnd(sti->parser->duration,
                                      (AVRational) { 1, sti->avctx->sample_rate 
},

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

Reply via email to