From 05bffc12c4faff47aabe08bafe44ee3b31ed5b47 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 31 Aug 2011 08:51:15 +0200 Subject: avconv: move audio_sample_fmt to options context. Also document it and replace undocumented and inconsistent '-sample_fmt list' syntax with -sample_fmts. --- cmdutils.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmdutils.c') diff --git a/cmdutils.c b/cmdutils.c index 52ec96f..2aab395 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -717,6 +717,15 @@ void show_pix_fmts(void) } } +int show_sample_fmts(const char *opt, const char *arg) +{ + int i; + char fmt_str[128]; + for (i = -1; i < AV_SAMPLE_FMT_NB; i++) + printf("%s\n", av_get_sample_fmt_string(fmt_str, sizeof(fmt_str), i)); + return 0; +} + int read_yesno(void) { int c = getchar(); -- cgit v1.1 From 2c474ddbc5b90541ea4a65961490b6469d12529f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 31 Aug 2011 22:24:06 +0200 Subject: cmdutils: add support for programs in check_stream_specifier() Remove now redundant (and broken/undocumented) opt_programid. --- cmdutils.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'cmdutils.c') diff --git a/cmdutils.c b/cmdutils.c index 2aab395..16b64af 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -841,6 +841,26 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec) return 0; } return 1; + } else if (*spec == 'p' && *(spec + 1) == ':') { + int prog_id, i, j; + char *endptr; + spec += 2; + prog_id = strtol(spec, &endptr, 0); + for (i = 0; i < s->nb_programs; i++) { + if (s->programs[i]->id != prog_id) + continue; + + if (*endptr++ == ':') { + int stream_idx = strtol(endptr, NULL, 0); + return (stream_idx >= 0 && stream_idx < s->programs[i]->nb_stream_indexes && + st->index == s->programs[i]->stream_index[stream_idx]); + } + + for (j = 0; j < s->programs[i]->nb_stream_indexes; j++) + if (st->index == s->programs[i]->stream_index[j]) + return 1; + } + return 0; } else if (!*spec) /* empty specifier, matches everything */ return 1; -- cgit v1.1