Browse Source

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

Fixes ticket #4818.

Reviewed-by: Ronald S. Bultje
Reviewed-by: Paul B Mahol
tags/n2.8
Carl Eugen Hoyos 9 years ago
parent
commit
3eae98c1ac
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      libavformat/dv.c

+ 6
- 1
libavformat/dv.c View File

@@ -553,12 +553,17 @@ static int dv_read_packet(AVFormatContext *s, AVPacket *pkt)
size = avpriv_dv_get_packet(c->dv_demux, pkt); size = avpriv_dv_get_packet(c->dv_demux, pkt);


if (size < 0) { if (size < 0) {
int ret;
int64_t pos = avio_tell(s->pb); int64_t pos = avio_tell(s->pb);
if (!c->dv_demux->sys) if (!c->dv_demux->sys)
return AVERROR(EIO); return AVERROR(EIO);
size = c->dv_demux->sys->frame_size; 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); return AVERROR(EIO);
}


size = avpriv_dv_produce_packet(c->dv_demux, pkt, c->buf, size, pos); size = avpriv_dv_produce_packet(c->dv_demux, pkt, c->buf, size, pos);
} }


Loading…
Cancel
Save