summaryrefslogtreecommitdiff
path: root/libavformat/wv.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2011-08-20 18:14:58 +0200
committerLuca Barbato <lu_zero@gentoo.org>2011-08-21 12:54:35 +0200
commit5561fe487f0a2d522fd5655c129acf99b0d59490 (patch)
treea93d2e3121c35f0232a88f83e503131969f21a19 /libavformat/wv.c
parent4ba8c521b1119c8235f8ad83c4edecb0bf9feb10 (diff)
WavPack demuxer: store position of the first block in index.
Currently for multichannel audio position for the last block position is stored in index (and used for seeking), which is obviously not correct. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/wv.c')
-rw-r--r--libavformat/wv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/wv.c b/libavformat/wv.c
index 7cace17f0b..5c9c31c72a 100644
--- a/libavformat/wv.c
+++ b/libavformat/wv.c
@@ -250,6 +250,7 @@ static int wv_read_packet(AVFormatContext *s,
WVContext *wc = s->priv_data;
int ret;
int size, ver, off;
+ int64_t pos;
if (s->pb->eof_reached)
return AVERROR(EIO);
@@ -258,6 +259,7 @@ static int wv_read_packet(AVFormatContext *s,
return -1;
}
+ pos = wc->pos;
off = wc->multichannel ? 4 : 0;
if(av_new_packet(pkt, wc->blksize + WV_EXTRA_SIZE + off) < 0)
return AVERROR(ENOMEM);
@@ -314,7 +316,7 @@ static int wv_read_packet(AVFormatContext *s,
pkt->stream_index = 0;
wc->block_parsed = 1;
pkt->pts = wc->soff;
- av_add_index_entry(s->streams[0], wc->pos, pkt->pts, 0, 0, AVINDEX_KEYFRAME);
+ av_add_index_entry(s->streams[0], pos, pkt->pts, 0, 0, AVINDEX_KEYFRAME);
return 0;
}