Add switch for mono files

git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@767 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
bxaimc 2010-03-30 03:50:42 +00:00
parent 55d3170c14
commit eb17ddd68c

View File

@ -9,6 +9,7 @@ VGMSTREAM * init_vgmstream_ps2_vsf(STREAMFILE *streamFile) {
int loop_flag;
int channel_count;
int channel_switch;
/* check extension, case insensitive */
streamFile->get_name(streamFile,filename,sizeof(filename));
@ -18,10 +19,16 @@ VGMSTREAM * init_vgmstream_ps2_vsf(STREAMFILE *streamFile) {
if (read_32bitBE(0x00,streamFile) != 0x56534600) /* "VSF" */
goto fail;
loop_flag = (read_32bitLE(0x1c,streamFile)==0x13);
channel_count = 2;
channel_switch = read_32bitLE(0x8,streamFile);
switch (channel_switch){
case 0x0:
channel_count = 1;
break;
case 0x02:
channel_count = 2;
break;
}
/* build the VGMSTREAM */
vgmstream = allocate_vgmstream(channel_count,loop_flag);
if (!vgmstream) goto fail;