Commit 3eae98c1 authored by Carl Eugen Hoyos's avatar 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
parent 9dbc50b4
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment