Merge remote-tracking branch 'qatar/master'

* qatar/master:
  avconv: Match stream id

Conflicts:
	cmdutils.c
	doc/fftools-common-opts.texi

See: ea07063fd8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-03-13 14:16:00 +01:00
commit bb6de15d92
2 changed files with 8 additions and 6 deletions

View File

@ -44,8 +44,8 @@ streams of this type.
If @var{stream_index} is given, then it matches the stream with number @var{stream_index}
in the program with the id @var{program_id}. Otherwise, it matches all streams in the
program.
@item #@var{stream_id}
Matches the stream by a format-specific ID.
@item #@var{stream_id} or i:@var{stream_id}
Match the stream by stream id (e.g. PID in MPEG-TS container).
@end table
@section Generic options

View File

@ -4468,12 +4468,14 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
return 1;
}
return 0;
} else if (*spec == '#') {
int sid;
} else if (*spec == '#' ||
(*spec == 'i' && *(spec + 1) == ':')) {
int stream_id;
char *endptr;
sid = strtol(spec + 1, &endptr, 0);
spec += 1 + (*spec == 'i');
stream_id = strtol(spec, &endptr, 0);
if (!*endptr)
return st->id == sid;
return stream_id == st->id;
} else if (!*spec) /* empty specifier, matches everything */
return 1;