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 d09b0c5e17 fftools/ffmpeg_opt: return an error when refusing overwrite
d09b0c5e17 is described below
commit d09b0c5e1707dc21ecb7df8195d9f896d5c13606
Author: 张永鹏 <[email protected]>
AuthorDate: Thu Jul 16 18:49:06 2026 +0800
Commit: Romain Beauxis <[email protected]>
CommitDate: Sun Aug 2 11:33:56 2026 -0500
fftools/ffmpeg_opt: return an error when refusing overwrite
Return EEXIST when output overwrite is refused so ffmpeg exits with a
non-zero status for -n and interactive no responses.
Signed-off-by: 张永鹏 <[email protected]>
---
fftools/ffmpeg_opt.c | 4 ++--
tests/fate/ffmpeg.mak | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 4e05e2c56b..9a6b97eb25 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -831,13 +831,13 @@ int assert_file_overwrite(const char *filename)
signal(SIGINT, SIG_DFL);
if (!read_yesno()) {
av_log(NULL, AV_LOG_FATAL, "Not overwriting - exiting\n");
- return AVERROR_EXIT;
+ return AVERROR(EEXIST);
}
term_init();
}
else {
av_log(NULL, AV_LOG_FATAL, "File '%s' already exists.
Exiting.\n", filename);
- return AVERROR_EXIT;
+ return AVERROR(EEXIST);
}
}
}
diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index 55c9ceb6bd..ad8e5c775f 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -244,6 +244,10 @@ fate-ffmpeg-error-rate-fail: CMD = ffmpeg -i
$(TARGET_SAMPLES)/mkv/h264_tta_unde
fate-ffmpeg-error-rate-pass: CMD = ffmpeg -i
$(TARGET_SAMPLES)/mkv/h264_tta_undecodable.mkv -c:v copy -f null -
-max_error_rate 1
FATE_SAMPLES_FFMPEG-$(call ENCDEC, PCM_S16LE TTA, NULL MATROSKA) +=
fate-ffmpeg-error-rate-fail fate-ffmpeg-error-rate-pass
+fate-ffmpeg-no-overwrite: CMP = null
+fate-ffmpeg-no-overwrite: CMD = out=tests/data/fate/no-overwrite.wav; touch
$$out; ffmpeg -f lavfi -i anullsrc -t 0.01 -c:a pcm_u8 -f wav -n $$out;
ret=$$?; rm -f $$out; test $$ret -ne 0
+FATE_FFMPEG-$(call ALLYES, LAVFI_INDEV ANULLSRC_FILTER PCM_U8_DECODER
PCM_U8_ENCODER WAV_MUXER FILE_PROTOCOL) += fate-ffmpeg-no-overwrite
+
# test input -bsf
# use -stream_loop, because it tests flushing bsfs
fate-ffmpeg-bsf-input: CMD = framecrc -stream_loop 2 -bsf setts=PTS*2 -i
$(TARGET_SAMPLES)/hevc/extradata-reload-multi-stsd.mov -c copy
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]