summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-07-14 17:52:51 +0200
committerNicolas George <nicolas.george@normalesup.org>2012-07-19 16:32:45 +0200
commit52ab418588ba14a53b40a80ea32589f8844f3ce6 (patch)
tree0887245138eb96f4c434c0d9ea43ffd49fbcbdd2 /ffmpeg.c
parent6b7849e6da54d57d04c4816b1a0717c1527afc19 (diff)
ffmpeg: invert using_stdin and rename accordingly.
There are other reasons not to use stdin than having it as an input.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 26dd3a1df3..9057fe178a 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -158,7 +158,7 @@ static FILE *vstats_file;
static int audio_volume = 256;
static int exit_on_error = 0;
-static int using_stdin = 0;
+static int stdin_interaction = 1;
static int run_as_daemon = 0;
static volatile int received_nb_signals = 0;
static int64_t video_size = 0;
@@ -3593,7 +3593,7 @@ static int transcode(void)
if (ret < 0)
goto fail;
- if (!using_stdin) {
+ if (stdin_interaction) {
av_log(NULL, AV_LOG_INFO, "Press [q] to stop, [?] for help\n");
}
@@ -3610,7 +3610,7 @@ static int transcode(void)
int64_t cur_time= av_gettime();
/* if 'q' pressed, exits */
- if (!using_stdin)
+ if (stdin_interaction)
if (check_keyboard_interaction(cur_time) < 0)
break;
@@ -4290,7 +4290,7 @@ static void assert_file_overwrite(const char *filename)
(strchr(filename, ':') == NULL || filename[1] == ':' ||
av_strstart(filename, "file:", NULL))) {
if (avio_check(filename, 0) == 0) {
- if (!using_stdin && (!no_file_overwrite || file_overwrite)) {
+ if (stdin_interaction && (!no_file_overwrite || file_overwrite)) {
fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
fflush(stderr);
term_exit();
@@ -4361,8 +4361,8 @@ static int opt_input_file(OptionsContext *o, const char *opt, const char *filena
if (!strcmp(filename, "-"))
filename = "pipe:";
- using_stdin |= !strncmp(filename, "pipe:", 5) ||
- !strcmp(filename, "/dev/stdin");
+ stdin_interaction &= strncmp(filename, "pipe:", 5) &&
+ strcmp(filename, "/dev/stdin");
/* get default parameters from command line */
ic = avformat_alloc_context();