Commit 7f47790acb for ffmpeg
commit 7f47790acb3a804f52f8d8992a737856b114f78e
Author: Leo Bicknell <bicknell@ufp.org>
Date: Sat Nov 28 09:49:59 2026 -0500
fftools/ffmpeg_demux: fail on an unrecognised hwaccel output format
An unknown -hwaccel_output_format was logged at AV_LOG_FATAL, without a
trailing newline, but ffmpeg carried on with no output format set. With
-hwaccel the frames were then decoded in hardware and downloaded to
system memory, so a typo such as "videotoolbox" for "videotoolbox_vld"
silently defeated the purpose of the option, and the command still
exited with status 0.
Return AVERROR(EINVAL) and add the newline, as is already done for an
unrecognised -hwaccel a few lines below.
Signed-off-by: Leo Bicknell <bicknell@ufp.org>
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 5409dcdc6c..01301e073e 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -1682,7 +1682,8 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
ds->dec_opts.hwaccel_output_format = av_get_pix_fmt(hwaccel_output_format);
if (ds->dec_opts.hwaccel_output_format == AV_PIX_FMT_NONE) {
av_log(ist, AV_LOG_FATAL, "Unrecognised hwaccel output "
- "format: %s", hwaccel_output_format);
+ "format: %s\n", hwaccel_output_format);
+ return AVERROR(EINVAL);
}
} else {
ds->dec_opts.hwaccel_output_format = AV_PIX_FMT_NONE;