Commit 4f07fcd3 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '7748dd41'

* commit '7748dd41':
  avconv: add -n option to immediately exit when output files already exist

Conflicts:
	Changelog
	doc/ffmpeg.texi
	ffmpeg_opt.c

See: 0a4f0211Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 56e68237 7748dd41
......@@ -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" },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment