[FFmpeg-cvslog] avformat/librtmp: fix returning EOF from Read/Write
Timo Rothenpieler
git at videolan.org
Sat Jul 28 02:10:48 EEST 2018
ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Thu Jul 26 00:37:35 2018 +0200| [ed647ab79f9a54d8d3a8e345f6a1643b60b849f4] | committer: Timo Rothenpieler
avformat/librtmp: fix returning EOF from Read/Write
Ticket #7052
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed647ab79f9a54d8d3a8e345f6a1643b60b849f4
---
libavformat/librtmp.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index f3cfa9a8e2..43013e46e0 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -261,7 +261,10 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
LibRTMPContext *ctx = s->priv_data;
RTMP *r = &ctx->rtmp;
- return RTMP_Write(r, buf, size);
+ int ret = RTMP_Write(r, buf, size);
+ if (!ret)
+ return AVERROR_EOF;
+ return ret;
}
static int rtmp_read(URLContext *s, uint8_t *buf, int size)
@@ -269,7 +272,10 @@ static int rtmp_read(URLContext *s, uint8_t *buf, int size)
LibRTMPContext *ctx = s->priv_data;
RTMP *r = &ctx->rtmp;
- return RTMP_Read(r, buf, size);
+ int ret = RTMP_Read(r, buf, size);
+ if (!ret)
+ return AVERROR_EOF;
+ return ret;
}
static int rtmp_read_pause(URLContext *s, int pause)
More information about the ffmpeg-cvslog
mailing list