diff mbox

[FFmpeg-devel] avcodec/wmaprodec: support decoding up to 16 channels of xma

Message ID 5ccfac7f-b8d7-60c7-9251-0c121331c83c@maxton.xyz
State Accepted
Commit 1be4c8579024bd44265ce2f63c6a090aa1b21bc4
Headers show

Commit Message

Maxton Feb. 27, 2018, 9:49 a.m. UTC
On 2018-02-27 4:10, Carl Eugen Hoyos wrote:
> 2018-02-27 9:26 GMT+01:00 Maxton <maxton@maxton.xyz>:
>> I looked at the code in avcodec/wmaprodec.c and noticed that
>> the maximum number of channels was set to 8, but I think this
>> is a mistake as the number of channels should logically be
>>
>>        XMA_MAX_STREAMS * XMA_MAX_CHANNELS_STREAM
> Doesn't your explanation indicate you should (move the definition
> and) change "8" into this calculation?

That is certainly more clear. I've attached an updated patch.

Best
Maxton
From 96fb5788ca2406b1c898fb637d4951d8f01ecb3e Mon Sep 17 00:00:00 2001
From: Maxton <maxton@maxton.xyz>
Date: Tue, 27 Feb 2018 04:43:52 -0500
Subject: [PATCH] avcodec/wmaprodec: support decoding up to 16 channels of xma

Signed-off by: Maxton <maxton@maxton.xyz>
---
 libavcodec/wmaprodec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol March 1, 2018, 7:18 p.m. UTC | #1
On 2/27/18, Maxton <maxton@maxton.xyz> wrote:
> On 2018-02-27 4:10, Carl Eugen Hoyos wrote:
>> 2018-02-27 9:26 GMT+01:00 Maxton <maxton@maxton.xyz>:
>>> I looked at the code in avcodec/wmaprodec.c and noticed that
>>> the maximum number of channels was set to 8, but I think this
>>> is a mistake as the number of channels should logically be
>>>
>>>        XMA_MAX_STREAMS * XMA_MAX_CHANNELS_STREAM
>> Doesn't your explanation indicate you should (move the definition
>> and) change "8" into this calculation?
>
> That is certainly more clear. I've attached an updated patch.
>
> Best
> Maxton
>
>

Applied.
diff mbox

Patch

diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 77a49c9..9439bfa 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -107,8 +107,8 @@ 
 #define MAX_BANDS      29                                    ///< max number of scale factor bands
 #define MAX_FRAMESIZE  32768                                 ///< maximum compressed frame size
 #define XMA_MAX_STREAMS         8
-#define XMA_MAX_CHANNELS        8
 #define XMA_MAX_CHANNELS_STREAM 2
+#define XMA_MAX_CHANNELS        (XMA_MAX_STREAMS * XMA_MAX_CHANNELS_STREAM)
 
 #define WMAPRO_BLOCK_MIN_BITS  6                                           ///< log2 of min block size
 #define WMAPRO_BLOCK_MAX_BITS 13                                           ///< log2 of max block size