summaryrefslogtreecommitdiff
path: root/plugins/vorbis
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-03-24 09:18:29 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-03-24 09:18:29 +0100
commitc7ea2527a763b662fa307905050bd9f777afcf37 (patch)
tree763a93b11154457a2f21204f5cc066cb7cea69c6 /plugins/vorbis
parent66d2ce2da3e8c58fe70ccf559cca41758486ea1f (diff)
fixed vorbis >6 channels support (bug #1067)
Diffstat (limited to 'plugins/vorbis')
-rw-r--r--plugins/vorbis/vorbis.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c
index 5851a95f..21c31c1a 100644
--- a/plugins/vorbis/vorbis.c
+++ b/plugins/vorbis/vorbis.c
@@ -368,13 +368,20 @@ cvorbis_read (DB_fileinfo_t *_info, char *bytes, int size) {
if (ret > 0) {
// remap channels to wav format
int idx = _info->fmt.channels - 3;
- static int remap[4][6] = {
+ static int remap[6][8] = {
{0,2,1},
{0,1,2,3}, // should not be used
{0,2,1,3,4},
- {0,2,1,4,5,3}
+ {0,2,1,4,5,3},
+ {0,2,1,4,5,6,3},
+ {0,2,1,6,7,4,5,3}
};
+ if (_info->fmt.channels > 8) {
+ fprintf (stderr, "vorbis plugin doesn't support more than 8 channels\n");
+ return -1;
+ }
+
int i, j;
int16_t *src = temp;
int n = ret / samplesize;