diff options
author | Marton Balint <cus@passwd.hu> | 2015-08-31 21:22:46 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2015-09-02 21:35:21 +0200 |
commit | 26a0cd1b4b093f3f6e4f15d28a282ec45b87bb98 (patch) | |
tree | 141ac833a9543c903fa7edeb1d136758a383b415 /libavformat | |
parent | 863522431fb2fc7d35fce582fcaacdcf37fc3c44 (diff) | |
download | ffmpeg-26a0cd1b4b093f3f6e4f15d28a282ec45b87bb98.tar.gz |
lavf: add V as a video stream specifier which is not an attached picture
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 3833b1ffb3..e67147c246 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -4312,8 +4312,9 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st, if (*spec <= '9' && *spec >= '0') /* opt:index */ return strtol(spec, NULL, 0) == st->index; else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' || - *spec == 't') { /* opt:[vasdt] */ + *spec == 't' || *spec == 'V') { /* opt:[vasdtV] */ enum AVMediaType type; + int nopic = 0; switch (*spec++) { case 'v': type = AVMEDIA_TYPE_VIDEO; break; @@ -4321,15 +4322,20 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st, case 's': type = AVMEDIA_TYPE_SUBTITLE; break; case 'd': type = AVMEDIA_TYPE_DATA; break; case 't': type = AVMEDIA_TYPE_ATTACHMENT; break; + case 'V': type = AVMEDIA_TYPE_VIDEO; nopic = 1; break; default: av_assert0(0); } if (type != st->codec->codec_type) return 0; + if (nopic && (st->disposition & AV_DISPOSITION_ATTACHED_PIC)) + return 0; if (*spec++ == ':') { /* possibly followed by :index */ int i, index = strtol(spec, NULL, 0); for (i = 0; i < s->nb_streams; i++) - if (s->streams[i]->codec->codec_type == type && index-- == 0) - return i == st->index; + if (s->streams[i]->codec->codec_type == type && + !(nopic && (st->disposition & AV_DISPOSITION_ATTACHED_PIC)) && + index-- == 0) + return i == st->index; return 0; } return 1; |