Fixed FfmpegDecoder read callback returning EOF incorrectly.

This commit is contained in:
Casey Langen 2020-10-22 18:15:13 -07:00
parent e44c6be68d
commit fa694408c3

View File

@ -78,9 +78,11 @@ static int readCallback(void* opaque, uint8_t* buffer, int bufferSize) {
FfmpegDecoder* decoder = static_cast<FfmpegDecoder*>(opaque);
if (decoder && decoder->Stream()) {
auto count = decoder->Stream()->Read(buffer, (PositionType) bufferSize);
return (count == bufferSize) ? count : AVERROR_EOF;
if (count > 0) {
return count;
}
}
return 0;
return AVERROR_EOF;
}
static int writeCallback(void* opaque, uint8_t* buffer, int bufferSize) {