aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-08-06 03:38:12 +0200
committerReinhard Tartler <siretart@tauware.de>2014-02-02 12:29:54 -0500
commit2c0bfce4cb2d92f6add16fa09737865417fd226b (patch)
treef7dc7935bf0b8d2de0b4c2da56c8837067f1fd19
parentb68e5b119588cb1e01f8d16986f2a23db825d8b2 (diff)
downloadffmpeg-2c0bfce4cb2d92f6add16fa09737865417fd226b.tar.gz
avi: DV in AVI must be considered single stream
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org (cherry picked from commit 3485a07977f17b8d4709fb327be4fc29031032b7) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavformat/avidec.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 8d06c9a1d2..ca402f9549 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -882,7 +882,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)
continue;
@@ -1286,12 +1286,17 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
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;
@@ -1309,7 +1314,6 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
/* 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. */