Commit bb6de15d authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  avconv: Match stream id

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

See: ea07063fMerged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 7d7487e8 81498ceb
...@@ -44,8 +44,8 @@ streams of this type. ...@@ -44,8 +44,8 @@ streams of this type.
If @var{stream_index} is given, then it matches the stream with number @var{stream_index} 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 in the program with the id @var{program_id}. Otherwise, it matches all streams in the
program. program.
@item #@var{stream_id} @item #@var{stream_id} or i:@var{stream_id}
Matches the stream by a format-specific ID. Match the stream by stream id (e.g. PID in MPEG-TS container).
@end table @end table
@section Generic options @section Generic options
......
...@@ -4468,12 +4468,14 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st, ...@@ -4468,12 +4468,14 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
return 1; return 1;
} }
return 0; return 0;
} else if (*spec == '#') { } else if (*spec == '#' ||
int sid; (*spec == 'i' && *(spec + 1) == ':')) {
int stream_id;
char *endptr; char *endptr;
sid = strtol(spec + 1, &endptr, 0); spec += 1 + (*spec == 'i');
stream_id = strtol(spec, &endptr, 0);
if (!*endptr) if (!*endptr)
return st->id == sid; return stream_id == st->id;
} else if (!*spec) /* empty specifier, matches everything */ } else if (!*spec) /* empty specifier, matches everything */
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment