From 2b4273072dbb1dde2ab4bbbd30b3cef4042fc4fb Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 11 Feb 2023 22:56:10 +0100 Subject: [PATCH] avcodec/roqaudioenc: unbreak mono encoding --- libavcodec/roqaudioenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/roqaudioenc.c b/libavcodec/roqaudioenc.c index f0254adc70..81dccd09b5 100644 --- a/libavcodec/roqaudioenc.c +++ b/libavcodec/roqaudioenc.c @@ -174,7 +174,7 @@ static int roq_dpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, /* Write the actual samples */ for (i = 0; i < data_size; i++) - *out++ = dpcm_predict(&context->lastSample[i & 1], *in++); + *out++ = dpcm_predict(&context->lastSample[(i & 1) & stereo], *in++); avpkt->pts = context->input_frames <= 7 ? context->first_pts : frame->pts; avpkt->duration = data_size / channels;