diff options
author | Chris Robinson <[email protected]> | 2011-05-15 04:49:18 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-05-15 04:49:18 -0700 |
commit | 143c08bfcbba9cbd59ed61936e4adec0b109d41e (patch) | |
tree | 7734fdc951fac87c2f89b7c1e9ecd21807e8fcc9 /Alc/alsa.c | |
parent | b3902c89509e86b3a324254ae3a56329f89dbeba (diff) |
Use channel config strings in log output
Diffstat (limited to 'Alc/alsa.c')
-rw-r--r-- | Alc/alsa.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -606,17 +606,23 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) /* set channels (implicitly sets frame bits) */ if(i >= 0 && (i=psnd_pcm_hw_params_set_channels(data->pcmHandle, p, ChannelsFromDevFmt(device->FmtChans))) < 0) { - device->FmtChans = DevFmtStereo; if((i=psnd_pcm_hw_params_set_channels(data->pcmHandle, p, 2)) < 0) { - device->FmtChans = DevFmtMono; if((i=psnd_pcm_hw_params_set_channels(data->pcmHandle, p, 1)) < 0) err = "set channels"; - else if((device->Flags&DEVICE_CHANNELS_REQUEST)) - AL_PRINT("Failed to set requested channel config %#x, got mono instead\n", device->FmtChans); + else + { + if((device->Flags&DEVICE_CHANNELS_REQUEST)) + AL_PRINT("Failed to set %s, got Mono instead\n", DevFmtChannelsString(device->FmtChans)); + device->FmtChans = DevFmtMono; + } + } + else + { + if((device->Flags&DEVICE_CHANNELS_REQUEST)) + AL_PRINT("Failed to set %s, got Stereo instead\n", DevFmtChannelsString(device->FmtChans)); + device->FmtChans = DevFmtStereo; } - else if((device->Flags&DEVICE_CHANNELS_REQUEST)) - AL_PRINT("Failed to set requested channel config %#x, got stereo instead\n", device->FmtChans); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } if(i >= 0 && (i=psnd_pcm_hw_params_set_rate_resample(data->pcmHandle, p, 0)) < 0) @@ -672,7 +678,7 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) if(device->Frequency != rate) { if((device->Flags&DEVICE_FREQUENCY_REQUEST)) - AL_PRINT("Failed to set requested frequency %dhz, got %dhz instead\n", device->Frequency, rate); + AL_PRINT("Failed to set %dhz, got %dhz instead\n", device->Frequency, rate); device->Flags &= ~DEVICE_FREQUENCY_REQUEST; device->Frequency = rate; } |