From: ngaullier via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: ngaullier <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PR] fftools/ffprobe: keep decoder buffers unflushed for show_streams() (PR #21605)
Date: Thu, 29 Jan 2026 15:28:44 -0000
Message-ID: <176970052481.25.18385653050573282801@4457048688e7> (raw)
PR #21605 opened by ngaullier
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21605
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21605.patch
When a decoder buffer is flushed, parts of the private context is reset,
which may affect show_streams().
Example:
ffprobe -of flat fate-suite/ac3/mp3ac325-4864-small.ts \
-analyze_frames -show_entries stream=ltrt_cmixlev
Before: ltrt_cmixlev="0.000000"
After: ltrt_cmixlev="0.707107"
Currently, it seems that only ac3 downmix info is concerned.
(ac3 downmix options are exported since 376bb8481ada994ffe16d0a02f6c8767bac21016).
Fix regression since 045a8b15b19ec7f872fb01cfb986faeaa26cb8bb.
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
>From 0204f391722f8c82d49bb94220ef7c8429d2c6e5 Mon Sep 17 00:00:00 2001
From: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Date: Tue, 27 Jan 2026 17:29:11 +0100
Subject: [PATCH] fftools/ffprobe: keep decoder buffers unflushed for
show_streams()
When a decoder buffer is flushed, parts of the private context is reset,
which may affect show_streams().
Example:
ffprobe -of flat fate-suite/ac3/mp3ac325-4864-small.ts \
-analyze_frames -show_entries stream=ltrt_cmixlev
Before: ltrt_cmixlev="0.000000"
After: ltrt_cmixlev="0.707107"
Currently, it seems that only ac3 downmix info is concerned.
(ac3 downmix options are exported since 376bb8481ada994ffe16d0a02f6c8767bac21016).
Fix regression since 045a8b15b19ec7f872fb01cfb986faeaa26cb8bb.
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
---
fftools/ffprobe.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 67111bc31f..f256d781d0 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -1695,8 +1695,6 @@ static int read_interval_packets(AVTextFormatContext *tfc, InputFile *ifile,
pkt->stream_index = i;
if (do_read_frames) {
while (process_frame(tfc, ifile, frame, pkt, &(int){1}) > 0);
- if (ifile->streams[i].dec_ctx)
- avcodec_flush_buffers(ifile->streams[i].dec_ctx);
}
}
@@ -1710,6 +1708,18 @@ end:
return ret;
}
+static void flush_buffers(InputFile *ifile)
+{
+ int i;
+
+ if (!do_read_frames)
+ return;
+ for (i = 0; i < ifile->nb_streams; i++) {
+ if (ifile->streams[i].dec_ctx)
+ avcodec_flush_buffers(ifile->streams[i].dec_ctx);
+ }
+}
+
static int read_packets(AVTextFormatContext *tfc, InputFile *ifile)
{
AVFormatContext *fmt_ctx = ifile->fmt_ctx;
@@ -1721,6 +1731,10 @@ static int read_packets(AVTextFormatContext *tfc, InputFile *ifile)
ret = read_interval_packets(tfc, ifile, &interval, &cur_ts);
} else {
for (i = 0; i < read_intervals_nb; i++) {
+ /* flushing buffers can reset parts of the private context which may be
+ * readen by show_streams(), so only flush between each read_interval */
+ if (i)
+ flush_buffers(ifile);
ret = read_interval_packets(tfc, ifile, &read_intervals[i], &cur_ts);
if (ret < 0)
break;
--
2.52.0
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
reply other threads:[~2026-01-29 15:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176970052481.25.18385653050573282801@4457048688e7 \
--to=ffmpeg-devel@ffmpeg.org \
--cc=code@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git