mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 03:39:45 +00:00
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.
This commit is contained in:
parent
bf3dce6b59
commit
ea07063fd8
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user