diff options
Diffstat (limited to 'src/mumble')
-rw-r--r-- | src/mumble/ALSAAudio.cpp | 2 | ||||
-rw-r--r-- | src/mumble/About.cpp | 2 | ||||
-rw-r--r-- | src/mumble/PulseAudio.cpp | 17 |
3 files changed, 10 insertions, 11 deletions
diff --git a/src/mumble/ALSAAudio.cpp b/src/mumble/ALSAAudio.cpp index e468b4240..33ad654ab 100644 --- a/src/mumble/ALSAAudio.cpp +++ b/src/mumble/ALSAAudio.cpp @@ -517,7 +517,7 @@ void ALSAAudioOutput::run() { if (revents & POLLERR) { snd_pcm_prepare(pcm_handle); } else if (revents & POLLOUT) { - snd_pcm_sframes_t avail; + snd_pcm_sframes_t avail{}; ALSA_ERRCHECK(avail = snd_pcm_avail_update(pcm_handle)); while (avail >= static_cast<int>(period_size)) { stillRun = mix(outbuff, static_cast<int>(period_size)); diff --git a/src/mumble/About.cpp b/src/mumble/About.cpp index 23de1e028..e5101aa59 100644 --- a/src/mumble/About.cpp +++ b/src/mumble/About.cpp @@ -47,7 +47,7 @@ AboutDialog::AboutDialog(QWidget *p) : QDialog(p) { icon->setPixmap(g.mw->qiIcon.pixmap(g.mw->qiIcon.actualSize(QSize(128, 128)))); QLabel *text = new QLabel(about); - text->setTextInteractionFlags(Qt::TextSelectableByMouse); + text->setTextInteractionFlags(Qt::TextBrowserInteraction); text->setOpenExternalLinks(true); text->setText(tr( "<h3>Mumble (%1)</h3>" diff --git a/src/mumble/PulseAudio.cpp b/src/mumble/PulseAudio.cpp index 71f98b747..5028a373a 100644 --- a/src/mumble/PulseAudio.cpp +++ b/src/mumble/PulseAudio.cpp @@ -194,8 +194,9 @@ void PulseAudioSystem::eventCallback(pa_mainloop_api *api, pa_defer_event *) { pa_channel_map pcm = qhChanMap.value(odev); if ((pss.format != PA_SAMPLE_FLOAT32NE) && (pss.format != PA_SAMPLE_S16NE)) pss.format = PA_SAMPLE_FLOAT32NE; - if (pss.rate == 0) - pss.rate = SAMPLE_RATE; + + pss.rate = SAMPLE_RATE; + if ((pss.channels == 0) || (! g.s.doPositionalAudio())) pss.channels = 1; @@ -231,7 +232,7 @@ void PulseAudioSystem::eventCallback(pa_mainloop_api *api, pa_defer_event *) { pa_buffer_attr buff; const pa_sample_spec *pss = pa_stream_get_sample_spec(pasOutput); const size_t sampleSize = (pss->format == PA_SAMPLE_FLOAT32NE) ? sizeof(float) : sizeof(short); - const unsigned int iBlockLen = ((pao->iFrameSize * pss->rate) / SAMPLE_RATE) * pss->channels * static_cast<unsigned int>(sampleSize); + const unsigned int iBlockLen = pao->iFrameSize * pss->channels * static_cast<unsigned int>(sampleSize); buff.tlength = iBlockLen * (g.s.iOutputDelay+1); buff.minreq = iBlockLen; buff.maxlength = -1; @@ -264,8 +265,7 @@ void PulseAudioSystem::eventCallback(pa_mainloop_api *api, pa_defer_event *) { pa_sample_spec pss = qhSpecMap.value(idev); if ((pss.format != PA_SAMPLE_FLOAT32NE) && (pss.format != PA_SAMPLE_S16NE)) pss.format = PA_SAMPLE_FLOAT32NE; - if (pss.rate == 0) - pss.rate = SAMPLE_RATE; + pss.rate = SAMPLE_RATE; pss.channels = 1; pasInput = pa_stream_new(pacContext, "Microphone", &pss, NULL); @@ -296,7 +296,7 @@ void PulseAudioSystem::eventCallback(pa_mainloop_api *api, pa_defer_event *) { pa_buffer_attr buff; const pa_sample_spec *pss = pa_stream_get_sample_spec(pasInput); const size_t sampleSize = (pss->format == PA_SAMPLE_FLOAT32NE) ? sizeof(float) : sizeof(short); - const unsigned int iBlockLen = ((pai->iFrameSize * pss->rate) / SAMPLE_RATE) * pss->channels * static_cast<unsigned int>(sampleSize); + const unsigned int iBlockLen = pai->iFrameSize * pss->channels * static_cast<unsigned int>(sampleSize); buff.tlength = iBlockLen; buff.minreq = iBlockLen; buff.maxlength = -1; @@ -328,8 +328,7 @@ void PulseAudioSystem::eventCallback(pa_mainloop_api *api, pa_defer_event *) { pa_channel_map pcm = qhChanMap.value(edev); if ((pss.format != PA_SAMPLE_FLOAT32NE) && (pss.format != PA_SAMPLE_S16NE)) pss.format = PA_SAMPLE_FLOAT32NE; - if (pss.rate == 0) - pss.rate = SAMPLE_RATE; + pss.rate = SAMPLE_RATE; if ((pss.channels == 0) || (! g.s.bEchoMulti)) pss.channels = 1; @@ -362,7 +361,7 @@ void PulseAudioSystem::eventCallback(pa_mainloop_api *api, pa_defer_event *) { pa_buffer_attr buff; const pa_sample_spec *pss = pa_stream_get_sample_spec(pasSpeaker); const size_t sampleSize = (pss->format == PA_SAMPLE_FLOAT32NE) ? sizeof(float) : sizeof(short); - const unsigned int iBlockLen = ((pai->iFrameSize * pss->rate) / SAMPLE_RATE) * pss->channels * static_cast<unsigned int>(sampleSize); + const unsigned int iBlockLen = pai->iFrameSize * pss->channels * static_cast<unsigned int>(sampleSize); buff.tlength = iBlockLen; buff.minreq = iBlockLen; buff.maxlength = -1; |