Skip to content

Commit

Permalink
Merge remote-tracking branch 'qatar/master'
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
michaelni committed Sep 11, 2011
2 parents 5a6f4a1 + 6cfed11 commit 411cc5c
Show file tree
Hide file tree
Showing 17 changed files with 654 additions and 851 deletions.
545 changes: 226 additions & 319 deletions avconv.c

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions cmdutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions cmdutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ int opt_protocols(const char *opt, const char *arg);
*/
int opt_pix_fmts(const char *opt, const char *arg);

/**
* Print a listing containing all the sample formats supported by the
* program.
*/
int show_sample_fmts(const char *opt, const char *arg);

/**
* Return a positive value if a line read from standard input
* starts with [yY], otherwise return 0.
Expand Down
1 change: 1 addition & 0 deletions cmdutils_common_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
{ "protocols", OPT_EXIT, {(void*)opt_protocols}, "show available protocols" },
{ "filters", OPT_EXIT, {(void*)opt_filters }, "show available filters" },
{ "pix_fmts" , OPT_EXIT, {(void*)opt_pix_fmts }, "show available pixel formats" },
{ "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
{ "loglevel", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
Loading

0 comments on commit 411cc5c

Please sign in to comment.