[FFmpeg-cvslog] lavf/dv: Do not return EIO for every error (like EOF).

Carl Eugen Hoyos git at videolan.org
Wed Sep 2 01:00:38 CEST 2015


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Wed Sep  2 00:58:13 2015 +0200| [3eae98c1ac705d3f820a1800e81960146a80c61c] | committer: Carl Eugen Hoyos

lavf/dv: Do not return EIO for every error (like EOF).

Fixes ticket #4818.

Reviewed-by: Ronald S. Bultje
Reviewed-by: Paul B Mahol

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3eae98c1ac705d3f820a1800e81960146a80c61c
---

 libavformat/dv.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavformat/dv.c b/libavformat/dv.c
index 8500228..84c3061 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);
     }



More information about the ffmpeg-cvslog mailing list