Re: [FFmpeg-devel] [PATCH 1/3] examples/avio_reading: return AVERROR_EOF at EOF.
On Fri, Oct 27, 2017 at 9:46 PM, Nicolas Georgewrote: > Signed-off-by: Nicolas George LGTM Jan ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/3] examples/avio_reading: return AVERROR_EOF at EOF.
Signed-off-by: Nicolas George--- doc/examples/avio_reading.c | 2 ++ 1 file changed, 2 insertions(+) Unchanged. diff --git a/doc/examples/avio_reading.c b/doc/examples/avio_reading.c index 02474e907a..7860fd5e2f 100644 --- a/doc/examples/avio_reading.c +++ b/doc/examples/avio_reading.c @@ -44,6 +44,8 @@ static int read_packet(void *opaque, uint8_t *buf, int buf_size) struct buffer_data *bd = (struct buffer_data *)opaque; buf_size = FFMIN(buf_size, bd->size); +if (!buf_size) +return AVERROR_EOF; printf("ptr:%p size:%zu\n", bd->ptr, bd->size); /* copy internal buffer data to buf */ -- 2.14.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/3] examples/avio_reading: return AVERROR_EOF at EOF.
Signed-off-by: Nicolas George--- doc/examples/avio_reading.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/examples/avio_reading.c b/doc/examples/avio_reading.c index 02474e907a..7860fd5e2f 100644 --- a/doc/examples/avio_reading.c +++ b/doc/examples/avio_reading.c @@ -44,6 +44,8 @@ static int read_packet(void *opaque, uint8_t *buf, int buf_size) struct buffer_data *bd = (struct buffer_data *)opaque; buf_size = FFMIN(buf_size, bd->size); +if (!buf_size) +return AVERROR_EOF; printf("ptr:%p size:%zu\n", bd->ptr, bd->size); /* copy internal buffer data to buf */ -- 2.14.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel