summaryrefslogtreecommitdiff
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-08-06 03:38:12 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-10-10 07:28:03 +0200
commit756547ce7f4d67a18663503e2157aebed3531703 (patch)
tree0e7388ed94b26d57bbe8a889e42b3e748ca3542d /libavformat/avidec.c
parent1cac9accbd1f9b8596122d0735e37b97a844c514 (diff)
avi: DV in AVI must be considered single stream
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r--libavformat/avidec.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 971b3f5e22..9396a20c04 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -952,7 +952,7 @@ start_sync:
goto start_sync;
}
- n = get_stream_idx(d);
+ n = avi->dv_demux ? 0 : get_stream_idx(d);
if (!((i - avi->last_pkt_pos) & 1) &&
get_stream_idx(d + 1) < s->nb_streams)
@@ -1392,12 +1392,17 @@ static int avi_read_seek(AVFormatContext *s, int stream_index,
int64_t pos;
AVIStream *ast;
+ /* Does not matter which stream is requested dv in avi has the
+ * stream information in the first video stream.
+ */
+ if (avi->dv_demux)
+ stream_index = 0;
+
if (!avi->index_loaded) {
/* we only load the index on demand */
avi_load_index(s);
avi->index_loaded = 1;
}
- assert(stream_index >= 0);
st = s->streams[stream_index];
ast = st->priv_data;
@@ -1418,7 +1423,6 @@ static int avi_read_seek(AVFormatContext *s, int stream_index,
/* One and only one real stream for DV in AVI, and it has video */
/* offsets. Calling with other stream indexes should have failed */
/* the av_index_search_timestamp call above. */
- assert(stream_index == 0);
/* Feed the DV video stream version of the timestamp to the */
/* DV demux so it can synthesize correct timestamps. */