[FFmpeg-devel,2/2] avcodec/alsdec: call correct function for multi-channel coding

Submitted by Paul B Mahol on July 1, 2017, 8:23 p.m.

Details

Message ID 20170701202307.2243-2-onemda@gmail.com
State New
Headers show

Commit Message

Paul B Mahol July 1, 2017, 8:23 p.m.
Fixes #5942.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/alsdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Thilo Borgmann July 2, 2017, 2:13 p.m.
Am 01.07.17 um 22:23 schrieb Paul B Mahol:
> Fixes #5942.
> 
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavcodec/alsdec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

OK if tested.

-Thilo

Patch hide | download patch | download mbox

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index ac59885..000a61d 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1616,9 +1616,9 @@  static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
     }
 
     if (!sconf->mc_coding || ctx->js_switch) {
-        int independent_bs = !sconf->joint_stereo;
-
         for (c = 0; c < avctx->channels; c++) {
+            int independent_bs = !(sconf->joint_stereo && (c < avctx->channels - 1) && (c % 2 == 0));
+
             js_blocks[0] = 0;
             js_blocks[1] = 0;