lavf: return AVERROR_EOF rather than EIO on EOF

This commit is contained in:
Anton Khirnov 2023-03-27 09:47:39 +02:00
parent 2e61ae2cbe
commit 3f4c41839d
6 changed files with 7 additions and 6 deletions

View File

@ -172,7 +172,7 @@ static int read_packet(AVFormatContext *s,
int tmp, record_size;
if (avio_feof(s->pb))
return AVERROR(EIO);
return AVERROR_EOF;
if (anm->page < 0)
return anm->page;

View File

@ -41,7 +41,7 @@ static int daud_packet(AVFormatContext *s, AVPacket *pkt) {
AVIOContext *pb = s->pb;
int ret, size;
if (avio_feof(pb))
return AVERROR(EIO);
return AVERROR_EOF;
size = avio_rb16(pb);
avio_rb16(pb); // unknown
ret = av_get_packet(pb, pkt, size);

View File

@ -86,7 +86,7 @@ static int read_packet(AVFormatContext *s,
AVStream *st = s->streams[0];
if (avio_feof(s->pb))
return AVERROR(EIO);
return AVERROR_EOF;
pkt->dts = avio_tell(s->pb) / (st->codecpar->width * (int64_t)(st->codecpar->height + film->leading) * 4);
pkt->size = av_get_packet(s->pb, pkt, st->codecpar->width * st->codecpar->height * 4);
avio_skip(s->pb, st->codecpar->width * (int64_t) film->leading * 4);

View File

@ -107,7 +107,7 @@ static int roq_read_packet(AVFormatContext *s,
while (!packet_read) {
if (avio_feof(s->pb))
return AVERROR(EIO);
return AVERROR_EOF;
/* get the next chunk preamble */
if ((ret = avio_read(pb, preamble, RoQ_CHUNK_PREAMBLE_SIZE)) !=

View File

@ -127,7 +127,8 @@ static int sol_read_packet(AVFormatContext *s,
int ret;
if (avio_feof(s->pb))
return AVERROR(EIO);
return AVERROR_EOF;
ret= av_get_packet(s->pb, pkt, MAX_SIZE);
if (ret < 0)
return ret;

View File

@ -101,7 +101,7 @@ static int vc1t_read_packet(AVFormatContext *s,
uint32_t pts;
if(avio_feof(pb))
return AVERROR(EIO);
return AVERROR_EOF;
frame_size = avio_rl24(pb);
if(avio_r8(pb) & 0x80)