diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-05-20 12:30:16 +0200 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-05-20 12:47:27 +0200 |
commit | ea07063fd82686af3fabb45e5ed10aa48d084d61 (patch) | |
tree | 4155a495d1499fe71651e8675ec07491283c1e4a /cmdutils.c | |
parent | bf3dce6b593826f40dd423a74b44f08bf70cd757 (diff) | |
download | ffmpeg-ea07063fd82686af3fabb45e5ed10aa48d084d61.tar.gz |
cmdutils: allow to specify a stream by its ID.
The stream can be specified as "#129" or "#0x81".
It is especially useful for VOBs dumped from a DVD,
where the language-id mapping is available externally
and the probing can find the streams in a random order.
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 6 |
1 files changed, 6 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; |