aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2015-09-02 00:58:13 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2015-09-02 00:59:10 +0200
commit3eae98c1ac705d3f820a1800e81960146a80c61c (patch)
tree25b800d81c09a606c59a67086593139388b1f6c6
parent9dbc50b4cdaf6de5a4d52bdaa3d4d1a0df5efadd (diff)
downloadffmpeg-3eae98c1ac705d3f820a1800e81960146a80c61c.tar.gz
lavf/dv: Do not return EIO for every error (like EOF).
Fixes ticket #4818. Reviewed-by: Ronald S. Bultje Reviewed-by: Paul B Mahol
-rw-r--r--libavformat/dv.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 8500228964..84c306114b 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -553,12 +553,17 @@ static int dv_read_packet(AVFormatContext *s, AVPacket *pkt)
size = avpriv_dv_get_packet(c->dv_demux, pkt);
if (size < 0) {
+ int ret;
int64_t pos = avio_tell(s->pb);
if (!c->dv_demux->sys)
return AVERROR(EIO);
size = c->dv_demux->sys->frame_size;
- if (avio_read(s->pb, c->buf, size) <= 0)
+ ret = avio_read(s->pb, c->buf, size);
+ if (ret < 0) {
+ return ret;
+ } else if (ret == 0) {
return AVERROR(EIO);
+ }
size = avpriv_dv_produce_packet(c->dv_demux, pkt, c->buf, size, pos);
}