ffmpeg: Make read_packet return AVERROR_EOF

Newer versions of FFmpeg deprecate returning 0 to indicate
EOF, and instead request use of AVERROR_EOF.

The oldest supported versions of FFmpeg/libav will treat any
error code the same as returning 0.

Fixes #315
This commit is contained in:
Sam Edwards 2018-05-26 15:17:34 -06:00
parent 5c9705c21c
commit e4c9526e08

View File

@ -209,7 +209,7 @@ read_packet(void *opaque, uint8_t *buf, int size) {
streampos remaining = self->_start + (streampos)self->_size - in->tellg();
if (remaining < ssize) {
if (remaining <= 0) {
return 0;
return AVERROR_EOF;
}
ssize = remaining;