diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-10-04 03:57:07 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-10-04 03:57:07 (GMT) |
commit | abcea22c5ba45d00c713d25a77773efbf6d941f7 (patch) | |
tree | 9cd98ebad82fc8ef80ff53c47da10f80ec114ffe /src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp | |
parent | 33b76a659b2f44fa7038e375bbfb4cfd449ae617 (diff) | |
parent | e2c45cbacaa0f48e1397572d3e5baa847c86e9b1 (diff) | |
download | Qt-abcea22c5ba45d00c713d25a77773efbf6d941f7.zip Qt-abcea22c5ba45d00c713d25a77773efbf6d941f7.tar.gz Qt-abcea22c5ba45d00c713d25a77773efbf6d941f7.tar.bz2 |
Merge remote branch 'origin/4.6' into 4.7-from-4.6
Conflicts:
src/multimedia/audio/qaudioinput_win32_p.cpp
Diffstat (limited to 'src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp')
-rw-r--r-- | src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp index 633b309..25622a4 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.cpp @@ -257,37 +257,40 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const // set the values! snd_pcm_hw_params_set_channels(handle,params,format.channels()); snd_pcm_hw_params_set_rate(handle,params,format.frequency(),dir); + + err = -1; + switch(format.sampleSize()) { case 8: if(format.sampleType() == QAudioFormat::SignedInt) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S8); + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S8); else if(format.sampleType() == QAudioFormat::UnSignedInt) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U8); + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U8); break; case 16: if(format.sampleType() == QAudioFormat::SignedInt) { if(format.byteOrder() == QAudioFormat::LittleEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_LE); + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_LE); else if(format.byteOrder() == QAudioFormat::BigEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_BE); + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S16_BE); } else if(format.sampleType() == QAudioFormat::UnSignedInt) { if(format.byteOrder() == QAudioFormat::LittleEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_LE); + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_LE); else if(format.byteOrder() == QAudioFormat::BigEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_BE); + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U16_BE); } break; case 32: if(format.sampleType() == QAudioFormat::SignedInt) { if(format.byteOrder() == QAudioFormat::LittleEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_LE); + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_LE); else if(format.byteOrder() == QAudioFormat::BigEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_BE); + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_S32_BE); } else if(format.sampleType() == QAudioFormat::UnSignedInt) { if(format.byteOrder() == QAudioFormat::LittleEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_LE); + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_LE); else if(format.byteOrder() == QAudioFormat::BigEndian) - snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_BE); + err = snd_pcm_hw_params_set_format(handle,params,SND_PCM_FORMAT_U32_BE); } } |