[FFmpeg-cvslog] lavf: return AVERROR_EOF rather than EIO on EOF

Anton Khirnov git at videolan.org
Mon Mar 27 18:16:42 EEST 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Mar 27 09:47:39 2023 +0200| [3f4c41839d5d3d02a12cc6a7407e6586996040e7] | committer: Anton Khirnov

lavf: return AVERROR_EOF rather than EIO on EOF

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

 libavformat/anm.c          | 2 +-
 libavformat/dauddec.c      | 2 +-
 libavformat/filmstripdec.c | 2 +-
 libavformat/idroqdec.c     | 2 +-
 libavformat/sol.c          | 3 ++-
 libavformat/vc1test.c      | 2 +-
 6 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/libavformat/anm.c b/libavformat/anm.c
index 7feba4ed1e..f2ac6958a9 100644
--- a/libavformat/anm.c
+++ b/libavformat/anm.c
@@ -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;
diff --git a/libavformat/dauddec.c b/libavformat/dauddec.c
index dbbd39a3b4..0cbf7e4e36 100644
--- a/libavformat/dauddec.c
+++ b/libavformat/dauddec.c
@@ -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);
diff --git a/libavformat/filmstripdec.c b/libavformat/filmstripdec.c
index 2b6ba63fcf..000f807181 100644
--- a/libavformat/filmstripdec.c
+++ b/libavformat/filmstripdec.c
@@ -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);
diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c
index c9fc972780..01ea2bb77b 100644
--- a/libavformat/idroqdec.c
+++ b/libavformat/idroqdec.c
@@ -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)) !=
diff --git a/libavformat/sol.c b/libavformat/sol.c
index b92cfb36fe..a276642728 100644
--- a/libavformat/sol.c
+++ b/libavformat/sol.c
@@ -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;
diff --git a/libavformat/vc1test.c b/libavformat/vc1test.c
index 67edc699c5..f63ffee69b 100644
--- a/libavformat/vc1test.c
+++ b/libavformat/vc1test.c
@@ -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)



More information about the ffmpeg-cvslog mailing list