From f6f958f679bdb8737db1b4be0140f3ad132f3cdd Mon Sep 17 00:00:00 2001 From: bnnm Date: Mon, 26 Aug 2019 23:00:17 +0200 Subject: [PATCH] Fix some buggy channel layouts [Ridge Racer 7 (PS3)] --- src/meta/riff.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/meta/riff.c b/src/meta/riff.c index 4310f883..62d2f073 100644 --- a/src/meta/riff.c +++ b/src/meta/riff.c @@ -123,10 +123,15 @@ static int read_fmt(int big_endian, STREAMFILE * streamFile, off_t current_chunk fmt->channel_layout = read_32bit(current_chunk+0x1c,streamFile); /* 0x10 guid at 0x20 */ - /* happens in .at3/at9, may be a bug in their encoder b/c MS's defs set mono as FC */ + /* happens in various .at3/at9, may be a bug in their encoder b/c MS's defs set mono as FC */ if (fmt->channel_count == 1 && fmt->channel_layout == speaker_FL) { /* other channels are fine */ fmt->channel_layout = speaker_FC; } + + /* happens in few at3p, may be a bug in older tools as other games have ok flags [Ridge Racer 7 (PS3)] */ + if (fmt->channel_count == 6 && fmt->channel_layout == 0x013f) { + fmt->channel_layout = 0x3f; + } } switch (fmt->codec) {