ffmpeg: fix incorrect error check

The function returns a positive nonzero value when it works.

Change-Id: I99ee3e2f8f60dff960a07fefc1cf42dc3b3969cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6013
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
PulkoMandy
2023-01-25 11:58:15 +00:00
committed by Adrien Destugues
parent e35a296ef7
commit a5bcb6e0e6
@@ -547,11 +547,11 @@ AVCodecEncoder::_EncodeAudio(const uint8* buffer, size_t bufferSize,
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;
}