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 | |
parent | b3902c89509e86b3a324254ae3a56329f89dbeba (diff) |
Use channel config strings in log output
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/alsa.c | 20 | ||||
-rw-r--r-- | Alc/coreaudio.c | 14 | ||||
-rw-r--r-- | Alc/oss.c | 12 | ||||
-rw-r--r-- | Alc/winmm.c | 2 |
4 files changed, 27 insertions, 21 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; } diff --git a/Alc/coreaudio.c b/Alc/coreaudio.c index 1d086926..4cac049f 100644 --- a/Alc/coreaudio.c +++ b/Alc/coreaudio.c @@ -175,7 +175,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtMono) { - AL_PRINT("Failed to set requested channel config %#x, got mono instead\n", device->FmtChans); + AL_PRINT("Failed to set %s, got Mono instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtMono; @@ -184,7 +184,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtStereo) { - AL_PRINT("Failed to set requested channel config %#x, got stereo instead\n", device->FmtChans); + AL_PRINT("Failed to set %s, got Stereo instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtStereo; @@ -193,7 +193,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtQuad) { - AL_PRINT("Failed to set requested channel config %#x, got quad instead\n", device->FmtChans); + AL_PRINT("Failed to set %s, got Quad instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtQuad; @@ -202,7 +202,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtX51) { - AL_PRINT("Failed to set requested channel config %#x, got 5.1 instead\n", device->FmtChans); + AL_PRINT("Failed to set %s, got 5.1 Surround instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtX51; @@ -211,7 +211,7 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtX61) { - AL_PRINT("Failed to set requested channel config %#x, got 6.1 instead\n", device->FmtChans); + AL_PRINT("Failed to set %s, got 6.1 Surround instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtX61; @@ -220,13 +220,13 @@ static ALCboolean ca_reset_playback(ALCdevice *device) if((device->Flags&DEVICE_CHANNELS_REQUEST) && device->FmtChans != DevFmtX71) { - AL_PRINT("Failed to set requested channel config %#x, got 7.1 instead\n", device->FmtChans); + AL_PRINT("Failed to set %s, got 7.1 Surround instead\n", DevFmtChannelsString(device->FmtChans)); device->Flags &= ~DEVICE_CHANNELS_REQUEST; } device->FmtChans = DevFmtX71; break; default: - AL_PRINT("Unhandled channel count (%d), using stereo\n", streamFormat.mChannelsPerFrame); + AL_PRINT("Unhandled channel count (%d), using Stereo\n", streamFormat.mChannelsPerFrame); device->Flags &= ~DEVICE_CHANNELS_REQUEST; device->FmtChans = DevFmtStereo; streamFormat.mChannelsPerFrame = 2; @@ -250,7 +250,7 @@ static ALCboolean oss_reset_playback(ALCdevice *device) if((int)ChannelsFromDevFmt(device->FmtChans) != numChannels) { - AL_PRINT("Could not set %d channels, got %d instead\n", ChannelsFromDevFmt(device->FmtChans), numChannels); + AL_PRINT("Failed to set %s, got %d channels instead\n", DevFmtChannelsString(device->FmtChans), numChannels); return ALC_FALSE; } @@ -258,14 +258,14 @@ static ALCboolean oss_reset_playback(ALCdevice *device) (ossFormat == AFMT_U8 && device->FmtType == DevFmtUByte) || (ossFormat == AFMT_S16_NE && device->FmtType == DevFmtShort))) { - AL_PRINT("Could not set %#x format type, got OSS format %#x\n", device->FmtType, ossFormat); + AL_PRINT("Failed to set %s output, got OSS format %#x\n", DevFmtTypeString(device->FmtType), ossFormat); return ALC_FALSE; } if(device->Frequency != (ALuint)ossSpeed) { if((device->Flags&DEVICE_FREQUENCY_REQUEST)) - AL_PRINT("Failed to set requested frequency %dhz, got %dhz instead\n", device->Frequency, ossSpeed); + AL_PRINT("Failed to set %dhz, got %dhz instead\n", device->Frequency, ossSpeed); device->Flags &= ~DEVICE_FREQUENCY_REQUEST; device->Frequency = ossSpeed; } @@ -354,7 +354,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) case DevFmtUShort: case DevFmtFloat: free(data); - AL_PRINT("Format type %#x capture not supported on OSS\n", device->FmtType); + AL_PRINT("%s capture samples not supported on OSS\n", DevFmtTypeString(device->FmtType)); return ALC_FALSE; } @@ -391,7 +391,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) if((int)ChannelsFromDevFmt(device->FmtChans) != numChannels) { - AL_PRINT("Could not set %d channels, got %d instead\n", ChannelsFromDevFmt(device->FmtChans), numChannels); + AL_PRINT("Failed to set %s, got %d channels instead\n", DevFmtChannelsString(device->FmtChans), numChannels); close(data->fd); free(data); return ALC_FALSE; @@ -401,7 +401,7 @@ static ALCboolean oss_open_capture(ALCdevice *device, const ALCchar *deviceName) (ossFormat == AFMT_U8 && device->FmtType == DevFmtUByte) || (ossFormat == AFMT_S16_NE && device->FmtType == DevFmtShort))) { - AL_PRINT("Could not set %#x format type, got OSS format %#x\n", device->FmtType, ossFormat); + AL_PRINT("Failed to set %s output, got OSS format %#x\n", DevFmtTypeString(device->FmtType), ossFormat); close(data->fd); free(data); return ALC_FALSE; diff --git a/Alc/winmm.c b/Alc/winmm.c index 1191d490..568d0f84 100644 --- a/Alc/winmm.c +++ b/Alc/winmm.c @@ -341,7 +341,7 @@ static ALCboolean WinMMOpenPlayback(ALCdevice *pDevice, const ALCchar *deviceNam if((pDevice->Flags&DEVICE_CHANNELS_REQUEST) && pDevice->FmtChans != DevFmtStereo) { - AL_PRINT("Failed to set requested channel config %#x, got stereo instead\n", pDevice->FmtChans); + AL_PRINT("Failed to set %s, got Stereo instead\n", DevFmtChannelsString(pDevice->FmtChans)); pDevice->Flags &= ~DEVICE_CHANNELS_REQUEST; } pDevice->FmtChans = DevFmtStereo; |