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

Maxton maxton at maxton.xyz
Tue Feb 27 10:26:51 EET 2018


Hello,

This is my first contribution to FFmpeg, so I apologize if I am doing this
incorrectly. I had an XMA2-encoded file which was not being decoded because it
had too many channels. 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

which is 16. Below I've linked to a file which does not work without my patch,
but decodes fine with the patch applied. I also ran `make fate` without any
failures.

https://music.maxton.xyz/files/files-secret/Layla.xma

Regards,

Maxton

-------------- next part --------------
From a493540b075cf61a17168db366d6ccb88eddbd81 Mon Sep 17 00:00:00 2001
From: Maxton <maxton at maxton.xyz>
Date: Tue, 27 Feb 2018 00:12:33 -0500
Subject: [PATCH] avcodec/wmaprodec: support decoding up to 16 channels of xma

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

diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 77a49c9..0460fce 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -107,7 +107,7 @@
 #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        16
 #define XMA_MAX_CHANNELS_STREAM 2
 
 #define WMAPRO_BLOCK_MIN_BITS  6                                           ///< log2 of min block size
-- 
2.7.4



More information about the ffmpeg-devel mailing list