Index: audio_low_latency_output_win.cc |
=================================================================== |
--- audio_low_latency_output_win.cc (revision 166575) |
+++ audio_low_latency_output_win.cc (working copy) |
@@ -375,6 +375,16 @@ |
return 0; |
} |
+static bool ChannelMixingSupported(int bytes_per_sample, int in_channels, |
+ int out_channels) { |
+ return bytes_per_sample == 2 && |
+ ((in_channels == 1 && out_channels == 2) || |
+ (in_channels == 1 && out_channels == 8) || |
+ (in_channels == 2 && out_channels == 6) || |
+ (in_channels == 2 && out_channels == 8) || |
+ (in_channels == 2 && out_channels == 1)); |
+} |
+ |
// static |
AUDCLNT_SHAREMODE WASAPIAudioOutputStream::GetShareMode() { |
const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
@@ -493,23 +503,15 @@ |
if (opened_) |
return true; |
- // Down-mixing is currently not supported. The number of channels provided |
- // by the audio source must be less than or equal to the number of native |
- // channels (given by endpoint_channel_count()) which is the channel count |
- // used when opening the default endpoint device. |
- if (channel_factor() < 1 && channel_factor() != 0.5f) { |
- LOG(ERROR) << "Channel down-mixing is not supported"; |
+ if (format_.Format.nChannels != client_channel_count_ && |
henrika (OOO until Aug 14)
2012/11/08 08:27:42
We could perhaps keep some comments. You removed t
DaleCurtis
2012/11/08 18:39:30
The old ones are out of date and the LOG(ERROR) ex
|
+ !ChannelMixingSupported( |
+ format_.Format.wBitsPerSample / 8, client_channel_count_, |
+ format_.Format.nChannels)) { |
+ LOG(ERROR) << "Channel mixing is not supported."; |
RecordFallbackStats(); |
return false; |
} |
- // Only 16-bit audio is supported in combination with channel up-mixing. |
- if (channel_factor() > 1 && (format_.Format.wBitsPerSample != 16)) { |
- LOG(ERROR) << "16-bit audio is required when channel up-mixing is active."; |
- RecordFallbackStats(); |
- return false; |
- } |
- |
// Create an IMMDeviceEnumerator interface and obtain a reference to |
// the IMMDevice interface of the default rendering device with the |
// specified role. |