ffmpeg: fix incorrect error check
The function returns a positive nonzero value when it works.
Change-Id: Ib5852ec1d71e44b67309f3b955b888708f2ba1cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6020
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Diff
src/add-ons/media/plugins/ffmpeg/AVCodecEncoder.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
@@ -590,11 +590,11 @@
av_frame_unref(fFrame);
fFrame->nb_samples = frameCount;
ret = avcodec_fill_audio_frame(fFrame, fCodecContext->channels,
int count = avcodec_fill_audio_frame(fFrame, fCodecContext->channels,
fCodecContext->sample_fmt, (const uint8_t *) buffer, bufferSize, 1);
if (ret != 0) {
TRACE(" avcodec_encode_audio() failed filling data: %ld\n", ret);
if (count < 0) {
TRACE(" avcodec_encode_audio() failed filling data: %d\n", count);
return B_ERROR;
}