diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2014-07-28 09:52:26 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2014-07-28 09:52:26 +0000 |
| commit | 579783f73845f7dafe1cd97ed109147282a7732f (patch) | |
| tree | cc911a8957142430993f3164e7dca2588f75e84e /src | |
| parent | ce067a84326fce70bf28d1fcd148fcfde5fa1f8f (diff) | |
| download | qmmp-579783f73845f7dafe1cd97ed109147282a7732f.tar.gz qmmp-579783f73845f7dafe1cd97ed109147282a7732f.tar.bz2 qmmp-579783f73845f7dafe1cd97ed109147282a7732f.zip | |
fixed freezing in the alsa plugin
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4389 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/Output/alsa/outputalsa.cpp | 8 | ||||
| -rw-r--r-- | src/plugins/Output/alsa/outputalsa.h | 1 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/plugins/Output/alsa/outputalsa.cpp b/src/plugins/Output/alsa/outputalsa.cpp index 8b5a04c5c..b0f6233f2 100644 --- a/src/plugins/Output/alsa/outputalsa.cpp +++ b/src/plugins/Output/alsa/outputalsa.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2012 by Ilya Kotov * + * Copyright (C) 2006-2014 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -18,9 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <QObject> -//#include <QApplication> -//#include <QtGlobal> #include <QDir> #include <QSettings> #include <QTimer> @@ -189,13 +186,12 @@ bool OutputALSA::initialize(quint32 freq, int chan, Qmmp::AudioFormat format) return false; } //setup needed values - m_bits_per_frame = snd_pcm_format_physical_width(alsa_format) * chan; m_chunk_size = period_size; m_can_pause = snd_pcm_hw_params_can_pause(hwparams) && use_pause; qDebug("OutputALSA: can pause: %d", m_can_pause); configure(freq, chan, format); //apply configuration //create alsa prebuffer; - m_prebuf_size = /*QMMP_BUFFER_SIZE + */m_bits_per_frame * m_chunk_size / 8; + m_prebuf_size = 2 * snd_pcm_frames_to_bytes(pcm_handle, m_chunk_size); //buffer for two periods m_prebuf = (uchar *)malloc(m_prebuf_size); m_inited = true; diff --git a/src/plugins/Output/alsa/outputalsa.h b/src/plugins/Output/alsa/outputalsa.h index c8e606f6c..1600e3b29 100644 --- a/src/plugins/Output/alsa/outputalsa.h +++ b/src/plugins/Output/alsa/outputalsa.h @@ -58,7 +58,6 @@ private: snd_pcm_t *pcm_handle; char *pcm_name; snd_pcm_uframes_t m_chunk_size; - size_t m_bits_per_frame; //prebuffer uchar *m_prebuf; qint64 m_prebuf_size; |
