diff options
Diffstat (limited to 'src/plugins/Output/alsa/outputalsa.cpp')
| -rw-r--r-- | src/plugins/Output/alsa/outputalsa.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/plugins/Output/alsa/outputalsa.cpp b/src/plugins/Output/alsa/outputalsa.cpp index 92f3ede32..3499097ea 100644 --- a/src/plugins/Output/alsa/outputalsa.cpp +++ b/src/plugins/Output/alsa/outputalsa.cpp @@ -39,8 +39,8 @@ OutputALSA::OutputALSA() : m_inited(false) QString dev_name = settings.value("ALSA/device","default").toString(); m_use_mmap = settings.value("ALSA/use_mmap", false).toBool(); pcm_name = strdup(dev_name.toLatin1().data()); - pcm_handle = 0; - m_prebuf = 0; + pcm_handle = nullptr; + m_prebuf = nullptr; m_prebuf_size = 0; m_prebuf_fill = 0; m_can_pause = false; @@ -90,8 +90,8 @@ bool OutputALSA::initialize(quint32 freq, ChannelMap map, Qmmp::AudioFormat form bool use_pause = settings.value("use_snd_pcm_pause", false).toBool(); settings.endGroup(); - snd_pcm_hw_params_t *hwparams = 0; - snd_pcm_sw_params_t *swparams = 0; + snd_pcm_hw_params_t *hwparams = nullptr; + snd_pcm_sw_params_t *swparams = nullptr; int err; //alsa error code //hw params @@ -143,7 +143,7 @@ bool OutputALSA::initialize(quint32 freq, ChannelMap map, Qmmp::AudioFormat form } exact_rate = rate; - if ((err = snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &exact_rate, 0)) < 0) + if ((err = snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &exact_rate, nullptr)) < 0) { qWarning("OutputALSA: Error setting rate: %s", snd_strerror(err)); return false; @@ -164,12 +164,12 @@ bool OutputALSA::initialize(quint32 freq, ChannelMap map, Qmmp::AudioFormat form qWarning("OutputALSA: The channel number %d is not supported by your hardware", map.count()); qWarning("==> Using %d instead.", c); } - if ((err = snd_pcm_hw_params_set_period_time_near(pcm_handle, hwparams, &period_time ,0)) < 0) + if ((err = snd_pcm_hw_params_set_period_time_near(pcm_handle, hwparams, &period_time, nullptr)) < 0) { qWarning("OutputALSA: Error setting period time: %s", snd_strerror(err)); return false; } - if ((err = snd_pcm_hw_params_set_buffer_time_near(pcm_handle, hwparams, &buffer_time ,0)) < 0) + if ((err = snd_pcm_hw_params_set_buffer_time_near(pcm_handle, hwparams, &buffer_time, nullptr)) < 0) { qWarning("OutputALSA: Error setting buffer time: %s", snd_strerror(err)); return false; @@ -187,7 +187,7 @@ bool OutputALSA::initialize(quint32 freq, ChannelMap map, Qmmp::AudioFormat form qWarning("OutputALSA: Error reading buffer size: %s", snd_strerror(err)); return false; } - if ((err = snd_pcm_hw_params_get_period_size(hwparams, &period_size, 0)) < 0) + if ((err = snd_pcm_hw_params_get_period_size(hwparams, &period_size, nullptr)) < 0) { qWarning("OutputALSA: Error reading period size: %s", snd_strerror(err)); return false; @@ -389,18 +389,18 @@ void OutputALSA::uninitialize() snd_pcm_drop(pcm_handle); qDebug("OutputALSA: closing pcm_handle"); snd_pcm_close(pcm_handle); - pcm_handle = 0; + pcm_handle = nullptr; } if (m_prebuf) free(m_prebuf); - m_prebuf = 0; + m_prebuf = nullptr; } /* ****** MIXER ******* */ VolumeALSA::VolumeALSA() { //alsa mixer - m_mixer = 0; + m_mixer = nullptr; QSettings settings(Qmmp::configFile(), QSettings::IniFormat); QString card = settings.value("ALSA/mixer_card","hw:0").toString(); QString dev = settings.value("ALSA/mixer_device", "PCM").toString(); @@ -443,7 +443,7 @@ int VolumeALSA::setupMixer(QString card, QString device) { char *name; int err, index; - pcm_element = 0; + pcm_element = nullptr; qDebug("OutputALSA: setupMixer()"); @@ -543,7 +543,7 @@ int VolumeALSA::getMixer(snd_mixer_t **mixer, QString card) qPrintable(card), snd_strerror(-err)); return -1; } - if ((err = snd_mixer_selem_register(*mixer, NULL, NULL)) < 0) + if ((err = snd_mixer_selem_register(*mixer, nullptr, nullptr)) < 0) { qWarning("OutputALSA: Failed to register mixer: %s", snd_strerror(-err)); |
