diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-13 14:16:00 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-13 14:21:27 +0100 |
commit | bb6de15d927dcbc5175387fdbb2c066243c1c6b4 (patch) | |
tree | 3a0140505a6493f69b5d0dcb7cd473374ae45613 | |
parent | 7d7487e85c066bf3f4e5821a49081f520b6bc1e7 (diff) | |
parent | 81498ceb5b2d1f72a3fd694849b1feaffc301e56 (diff) | |
download | ffmpeg-bb6de15d927dcbc5175387fdbb2c066243c1c6b4.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
avconv: Match stream id
Conflicts:
cmdutils.c
doc/fftools-common-opts.texi
See: ea07063fd82686af3fabb45e5ed10aa48d084d61
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | doc/fftools-common-opts.texi | 4 | ||||
-rw-r--r-- | libavformat/utils.c | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi index dcfe9b5a35..6bc6852d92 100644 --- a/doc/fftools-common-opts.texi +++ b/doc/fftools-common-opts.texi @@ -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 diff --git a/libavformat/utils.c b/libavformat/utils.c index 4065a790d6..8067567d6a 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -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; |