aboutsummaryrefslogtreecommitdiff
path: root/cmdutils.c
diff options
context:
space:
mode:
authorMichael Niedermayer2011-09-11 23:35:35 +0200
committerMichael Niedermayer2011-09-12 00:32:54 +0200
commit411cc5c46a89ce0a79832c37d0eab1ed884e5423 (patch)
tree0217179f24cd9629b568b521b1c749e51d6ea7c9 /cmdutils.c
parent5a6f4a130226e04e0db3bd7c7c1ff76fe3f06080 (diff)
parent6cfed1127005e9d79e03b4b04fd75124a291d3db (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (31 commits) audioconvert: add explanatory comments to channel_names array audioconvert: K&R whitespace cosmetics avconv: use correct index when selecting metadata to write to. avconv: fix inverted variable doc/avconv: document option types (input/output/per-stream/...) doc/avtools-common-opts: write a section about stream specifiers. doc/avconv: remove two pointless paragraphs. doc/avconv: document that global options should be specified first. doc/avconv: remove entries for nonexistent options doc/avconv: remove documentation for removed 'timestamp' option doc: cosmetics, rename fftools-common-opts to avtools-.... avconv: move streamid_map to options context. avconv: extend -vf syntax avconv: move top_field_first to options context. avconv: move inter/intra matrix to options context. avconv: remove -psnr option. avconv: remove me_threshold option. avconv: move video_rc_override_string to options context. avconv: move frame pixel format to the options context. avconv: move frame aspect ratio to the options context. ... Conflicts: avconv.c cmdutils_common_opts.h doc/avconv.texi Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c
index c72c74737b..f7b24f65bd 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -730,6 +730,15 @@ int opt_pix_fmts(const char *opt, const char *arg)
return 0;
}
+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();
@@ -836,6 +845,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;