diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2014-10-14 17:13:42 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2014-10-14 17:13:42 +0000 |
| commit | f9a510ef0024d602102ab94775376eb5807039e9 (patch) | |
| tree | bd7533f18e9412bd0cc5c2e92b65a15ee9aee538 /src | |
| parent | 6cb3ac8c74073690251106994df24d5bcc74788e (diff) | |
| download | qmmp-f9a510ef0024d602102ab94775376eb5807039e9.tar.gz qmmp-f9a510ef0024d602102ab94775376eb5807039e9.tar.bz2 qmmp-f9a510ef0024d602102ab94775376eb5807039e9.zip | |
alsa: ignore snd_pcm_get_chmap errors (Fixes issue 725)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4575 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/Output/alsa/outputalsa.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/plugins/Output/alsa/outputalsa.cpp b/src/plugins/Output/alsa/outputalsa.cpp index a01eed88a..9c18b97c1 100644 --- a/src/plugins/Output/alsa/outputalsa.cpp +++ b/src/plugins/Output/alsa/outputalsa.cpp @@ -209,30 +209,29 @@ bool OutputALSA::initialize(quint32 freq, ChannelMap map, Qmmp::AudioFormat form m_can_pause = snd_pcm_hw_params_can_pause(hwparams) && use_pause; qDebug("OutputALSA: can pause: %d", m_can_pause); - ChannelMap out_map; + ChannelMap out_map = map; #if (SND_LIB_VERSION >= 0x01001B) //channel map configuration snd_pcm_chmap_t *chmap = snd_pcm_get_chmap(pcm_handle); - if(!chmap) + if(chmap) { - qWarning("OutputALSA: Unable to receive current channel map: %s", snd_strerror(err)); - return false; - } - char tmp[256]; - memset(tmp,0,256); - snd_pcm_chmap_print(chmap, 256, tmp); - qDebug("OutputALSA: received channel map: %s",tmp); + out_map.clear(); + char tmp[256]; + memset(tmp,0,256); + snd_pcm_chmap_print(chmap, 256, tmp); + qDebug("OutputALSA: received channel map: %s",tmp); - for(uint i = 0; i < chmap->channels; ++i) - { - if(m_alsa_channels.keys().contains(chmap->pos[i])) - out_map.append(m_alsa_channels.value(chmap->pos[i])); - else - out_map.append(Qmmp::CHAN_NULL); + for(uint i = 0; i < chmap->channels; ++i) + { + if(m_alsa_channels.keys().contains(chmap->pos[i])) + out_map.append(m_alsa_channels.value(chmap->pos[i])); + else + out_map.append(Qmmp::CHAN_NULL); + } + free(chmap); } - free(chmap); -#else - out_map = map; + else + qWarning("OutputALSA: Unable to receive current channel map"); #endif configure(exact_rate, out_map, format); //apply configuration //create alsa prebuffer; |
