aboutsummaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2008-06-12 11:33:53 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2008-06-12 11:33:53 +0000
commitb81d6235c059e94ba7d07f846d5e1a6f1b825859 (patch)
tree8a4f645b7ed39b254e423c8939d161f00b15ef11 /ffplay.c
parent3022cd10a5561da0d9d7f5268220fba724afdcdb (diff)
downloadffmpeg-b81d6235c059e94ba7d07f846d5e1a6f1b825859.tar.gz
Change opt_sync function behavior to print an error message.
Patch by Stefano Sabatini stefano sabatini-lala poste it Originally committed as revision 13757 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ffplay.c b/ffplay.c
index e6c2e7fe5c..6e55e0f18b 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2389,7 +2389,7 @@ static void opt_frame_pix_fmt(const char *arg)
frame_pix_fmt = avcodec_get_pix_fmt(arg);
}
-static void opt_sync(const char *arg)
+static int opt_sync(const char *opt, const char *arg)
{
if (!strcmp(arg, "audio"))
av_sync_type = AV_SYNC_AUDIO_MASTER;
@@ -2398,9 +2398,10 @@ static void opt_sync(const char *arg)
else if (!strcmp(arg, "ext"))
av_sync_type = AV_SYNC_EXTERNAL_CLOCK;
else {
- show_help();
+ fprintf(stderr, "Unknown value for %s: %s\n", opt, arg);
exit(1);
}
+ return 0;
}
static int opt_seek(const char *opt, const char *arg)
@@ -2463,7 +2464,7 @@ static const OptionDef options[] = {
{ "idct", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&idct}, "set idct algo", "algo" },
{ "er", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_resilience}, "set error detection threshold (0-4)", "threshold" },
{ "ec", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_concealment}, "set error concealment options", "bit_mask" },
- { "sync", HAS_ARG | OPT_EXPERT, {(void*)opt_sync}, "set audio-video sync. type (type=audio/video/ext)", "type" },
+ { "sync", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_sync}, "set audio-video sync. type (type=audio/video/ext)", "type" },
{ "threads", HAS_ARG | OPT_FUNC2 | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
{ NULL, },
};