int qp_hist = 0;
static int file_overwrite = 0;
+static int file_skip = 0;
static int video_discard = 0;
static int intra_dc_precision = 8;
static int using_stdin = 0;
static void assert_file_overwrite(const char *filename)
{
+ if (file_overwrite && file_skip) {
+ 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 (!using_stdin) {
+ if (!using_stdin && !file_skip) {
fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
fflush(stderr);
if (!read_yesno()) {
"force format", "fmt" },
{ "y", OPT_BOOL, { &file_overwrite },
"overwrite output files" },
+ { "n", OPT_BOOL, { &file_skip },
+ "never overwrite output files" },
{ "c", HAS_ARG | OPT_STRING | OPT_SPEC |
OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(codec_names) },
"codec name", "codec" },
@item -y (@emph{global})
Overwrite output files without asking.
+@item -n (@emph{global})
+Immediately exit when output files already exist.
+
@item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
@itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
Select an encoder (when used before an output file) or a decoder (when used