summaryrefslogtreecommitdiff
path: root/libavformat/wv.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/wv.c')
-rw-r--r--libavformat/wv.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libavformat/wv.c b/libavformat/wv.c
index f6b96d5ce3..97a6c1f2e8 100644
--- a/libavformat/wv.c
+++ b/libavformat/wv.c
@@ -2,20 +2,20 @@
* WavPack demuxer
* Copyright (c) 2006,2011 Konstantin Shishkov
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -255,7 +255,8 @@ static int wv_read_header(AVFormatContext *s)
st->codec->bits_per_coded_sample = wc->bpp;
avpriv_set_pts_info(st, 64, 1, wc->rate);
st->start_time = 0;
- st->duration = wc->samples;
+ if (wc->samples != 0xFFFFFFFFu)
+ st->duration = wc->samples;
if (s->pb->seekable) {
int64_t cur = avio_tell(s->pb);
@@ -276,7 +277,7 @@ static int wv_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t pos;
uint32_t block_samples;
- if (s->pb->eof_reached)
+ if (url_feof(s->pb))
return AVERROR_EOF;
if (wc->block_parsed) {
if ((ret = wv_read_block_header(s, s->pb, 0)) < 0)
@@ -340,7 +341,7 @@ static int wv_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->stream_index = 0;
wc->block_parsed = 1;
pkt->pts = wc->soff;
- block_samples = AV_RN32(wc->extra);
+ block_samples = AV_RL32(wc->extra);
if (block_samples > INT32_MAX)
av_log(s, AV_LOG_WARNING,
"Too many samples in block: %"PRIu32"\n", block_samples);