[FFmpeg-cvslog] avformat/aviobuf: End grace period of allowing 0 from read_packet

Andreas Rheinhardt git at videolan.org
Wed Apr 28 00:15:39 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sat Mar  6 16:51:13 2021 +0100| [252500a78fe1a31abc79e6070d16f50382c39343] | committer: James Almer

avformat/aviobuf: End grace period of allowing 0 from read_packet

See a606f27f4c610708fa96e35eed7b7537d3d8f712.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavformat/aviobuf.c | 7 -------
 libavformat/version.h | 3 ---
 2 files changed, 10 deletions(-)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 518cb11129..1ecc7fb095 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -519,14 +519,7 @@ static int read_packet_wrapper(AVIOContext *s, uint8_t *buf, int size)
     if (!s->read_packet)
         return AVERROR(EINVAL);
     ret = s->read_packet(s->opaque, buf, size);
-#if FF_API_OLD_AVIO_EOF_0
-    if (!ret && !s->max_packet_size) {
-        av_log(NULL, AV_LOG_WARNING, "Invalid return value 0 for stream protocol\n");
-        ret = AVERROR_EOF;
-    }
-#else
     av_assert2(ret || s->max_packet_size);
-#endif
     return ret;
 }
 
diff --git a/libavformat/version.h b/libavformat/version.h
index 310b060d44..fbf32f8e1b 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -58,9 +58,6 @@
 #ifndef FF_API_LAVF_AVCTX
 #define FF_API_LAVF_AVCTX               (LIBAVFORMAT_VERSION_MAJOR < 59)
 #endif
-#ifndef FF_API_OLD_AVIO_EOF_0
-#define FF_API_OLD_AVIO_EOF_0           (LIBAVFORMAT_VERSION_MAJOR < 59)
-#endif
 #ifndef FF_API_OLD_RTSP_OPTIONS
 #define FF_API_OLD_RTSP_OPTIONS         (LIBAVFORMAT_VERSION_MAJOR < 59)
 #endif



More information about the ffmpeg-cvslog mailing list