diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2018-07-26 00:37:35 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2018-07-28 01:04:38 +0200 |
commit | ed647ab79f9a54d8d3a8e345f6a1643b60b849f4 (patch) | |
tree | b2760f06339ff11ddff4ee6000e5349ccc3f97ab | |
parent | 7ca892b7e5ca2a2cb23f860b2134bd51b060ad91 (diff) | |
download | ffmpeg-ed647ab79f9a54d8d3a8e345f6a1643b60b849f4.tar.gz |
avformat/librtmp: fix returning EOF from Read/Write
Ticket #7052
-rw-r--r-- | libavformat/librtmp.c | 10 |
1 files 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) |