FIX: Do not use stereo to surround upmixing, when no matrix available.

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@692 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
spacy51 2008-09-03 20:08:02 +00:00
parent 711d8e9f97
commit 82f2160a5e
1 changed files with 8 additions and 2 deletions

View File

@ -230,6 +230,7 @@ bool XAudio2_Output::init()
ASSERT( hr == S_OK ); ASSERT( hr == S_OK );
float *matrix = NULL; float *matrix = NULL;
matrix = (float*)malloc( sizeof( float ) * 2 * dd.OutputFormat.Format.nChannels ); matrix = (float*)malloc( sizeof( float ) * 2 * dd.OutputFormat.Format.nChannels );
bool matrixAvailable = true;
switch( dd.OutputFormat.Format.nChannels ) { switch( dd.OutputFormat.Format.nChannels ) {
case 4: // 4.0 case 4: // 4.0
//Speaker \ Left Source Right Source //Speaker \ Left Source Right Source
@ -276,9 +277,14 @@ bool XAudio2_Output::init()
/*Side L*/ matrix[12] = 1.0000f; matrix[13] = 0.0000f; /*Side L*/ matrix[12] = 1.0000f; matrix[13] = 0.0000f;
/*Side R*/ matrix[14] = 0.0000f; matrix[15] = 1.0000f; /*Side R*/ matrix[14] = 0.0000f; matrix[15] = 1.0000f;
break; break;
default:
matrixAvailable = false;
break;
}
if( matrixAvailable ) {
hr = sVoice->SetOutputMatrix( NULL, 2, dd.OutputFormat.Format.nChannels, matrix );
ASSERT( hr == S_OK );
} }
hr = sVoice->SetOutputMatrix( NULL, 2, dd.OutputFormat.Format.nChannels, matrix );
ASSERT( hr == S_OK );
free( matrix ); free( matrix );
matrix = NULL; matrix = NULL;
} }