diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-01 13:16:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-01 13:21:34 +0200 |
commit | 4f07fcd30b0e910d11e08172549a301beffd7e3a (patch) | |
tree | fe1cc9d566094c2d675926698e3843891812313e /ffmpeg_opt.c | |
parent | 56e682374ecd78daac42a6e0fc5da799c0d3786b (diff) | |
parent | 7748dd41be3d6dd6300f14263586af4ee104ead2 (diff) | |
download | ffmpeg-4f07fcd30b0e910d11e08172549a301beffd7e3a.tar.gz |
Merge commit '7748dd41be3d6dd6300f14263586af4ee104ead2'
* commit '7748dd41be3d6dd6300f14263586af4ee104ead2':
avconv: add -n option to immediately exit when output files already exist
Conflicts:
Changelog
doc/ffmpeg.texi
ffmpeg_opt.c
See: 0a4f02117b67c135a27e3490aea1631ad9f4312f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg_opt.c')
-rw-r--r-- | ffmpeg_opt.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 286f9736c5..6e7797f5ab 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -659,11 +659,16 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) static void assert_file_overwrite(const char *filename) { - if ((!file_overwrite || no_file_overwrite) && + if (file_overwrite && no_file_overwrite) { + fprintf(stderr, "Error, both -y and -n supplied. Exiting.\n"); + exit_program(1); + } + + if (!file_overwrite && (strchr(filename, ':') == NULL || filename[1] == ':' || av_strstart(filename, "file:", NULL))) { if (avio_check(filename, 0) == 0) { - if (stdin_interaction && (!no_file_overwrite || file_overwrite)) { + if (stdin_interaction && !no_file_overwrite) { fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename); fflush(stderr); term_exit(); @@ -2578,7 +2583,7 @@ const OptionDef options[] = { { "y", OPT_BOOL, { &file_overwrite }, "overwrite output files" }, { "n", OPT_BOOL, { &no_file_overwrite }, - "do not overwrite output files" }, + "never overwrite output files" }, { "c", HAS_ARG | OPT_STRING | OPT_SPEC | OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(codec_names) }, "codec name", "codec" }, |