summaryrefslogtreecommitdiff
path: root/plugins/vorbis
diff options
context:
space:
mode:
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;