]> git.sesse.net Git - ffmpeg/commitdiff
Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 13 Mar 2014 13:16:00 +0000 (14:16 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 13 Mar 2014 13:21:27 +0000 (14:21 +0100)
* qatar/master:
  avconv: Match stream id

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

See: ea07063fd82686af3fabb45e5ed10aa48d084d61
Merged-by: Michael Niedermayer <michaelni@gmx.at>
doc/fftools-common-opts.texi
libavformat/utils.c

index dcfe9b5a35e03d83735d8faeef8a103d67f5225d..6bc6852d92297d33b640dec23bdad358f57a4d13 100644 (file)
@@ -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
index 4065a790d65465a99cd1bd6699727c2bb3b166b6..8067567d6ac92172d4d7789e31b9895253c509df 100644 (file)
@@ -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;