Merge pull request #406 from bnnm/riff

Fix .at3/at9 mono files with wrong channel layout
This commit is contained in:
bnnm 2019-05-01 23:27:32 +02:00 committed by GitHub
commit 041cfa3738
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,6 +121,11 @@ static int read_fmt(int big_endian, STREAMFILE * streamFile, off_t current_chunk
//fmt->extra_samples = read_16bit(current_chunk+0x1a,streamFile); /* valid_bits_per_sample or samples_per_block */
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 */
if (fmt->channel_count == 1 && fmt->channel_layout == speaker_FL) { /* other channels are fine */
fmt->channel_layout = speaker_FC;
}
}
switch (fmt->codec) {
@ -158,7 +163,7 @@ static int read_fmt(int big_endian, STREAMFILE * streamFile, off_t current_chunk
}
break;
case 0x11: /* MS IMA ADPCM [Layton Brothers: Mystery Room (iOS/Android)] */
case 0x11: /* MS-IMA ADPCM [Layton Brothers: Mystery Room (iOS/Android)] */
if (fmt->bps != 4) goto fail;
fmt->coding_type = coding_MS_IMA;
break;