summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmdutils.c6
-rw-r--r--doc/avtools-common-opts.texi2
2 files changed, 8 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 2879a420c1..2c8439499d 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1109,6 +1109,12 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
return 1;
}
return 0;
+ } else if (*spec == '#') {
+ int sid;
+ char *endptr;
+ sid = strtol(spec + 1, &endptr, 0);
+ if (!*endptr)
+ return st->id == sid;
} else if (!*spec) /* empty specifier, matches everything */
return 1;
diff --git a/doc/avtools-common-opts.texi b/doc/avtools-common-opts.texi
index c25b535a9d..8246a7cc8f 100644
--- a/doc/avtools-common-opts.texi
+++ b/doc/avtools-common-opts.texi
@@ -41,6 +41,8 @@ streams of this type.
@item p:@var{program_id}[:@var{stream_index}]
If @var{stream_index} is given, then matches stream number @var{stream_index} in
program with id @var{program_id}. Otherwise matches all streams in this program.
+@item #@var{stream_id}
+Matches the stream by format-specific ID.
@end table
@section Generic options