1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-23 22:16:45 +02:00

avformat/librtmp: fix returning EOF from Read/Write

Ticket #7052
This commit is contained in:
Timo Rothenpieler 2018-07-26 00:37:35 +02:00
parent 7ca892b7e5
commit ed647ab79f

View File

@ -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)