The bug stills remains, it seems a bug in the reset() function in QAudioOutput not relly resetting the audio buffer...

This commit is contained in:
Santi Noreña 2014-07-13 21:39:30 +02:00
parent ad89b51aa3
commit 6ddd7c3232
2 changed files with 11 additions and 12 deletions

View file

@ -42,7 +42,6 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, QString name):
m_statusLabel->setText(STATUS_LABEL);
m_statusValue = new QLabel;
m_receiveDMX = new QCheckBox("Receiving DMX", this);
// m_receiveDMX->setCheckable(false);
m_receiveDMX->setChecked(false);
status->addWidget(m_receiveDMX);
status->addWidget(m_statusLabel);
@ -90,8 +89,6 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, QString name):
progressTime->addWidget(m_progressTimeLabel);
progressTime->addWidget(m_progressTime);
// QHBoxLayout *totalTime = new QHBoxLayout;
m_totalTimeLabel = new QLabel;
m_totalTimeLabel->setText(TOTAL_TIME_LABEL);
m_totalTimeValue = new QTimeEdit;
@ -101,7 +98,6 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, QString name):
m_totalTimeValue->setMaximumWidth(90);
progressTime->addWidget(m_totalTimeLabel);
progressTime->addWidget(m_totalTimeValue);
// layout->addLayout(totalTime);
layout->addLayout(progressTime);
QHBoxLayout *progressSlider = new QHBoxLayout;
@ -141,7 +137,9 @@ AudioLayerWidget::AudioLayerWidget(QWidget *parent, QString name):
connect(m_watchDMX, SIGNAL(timeout()),
this, SLOT(watchDMXExpired()));
m_watchDMX->start(1000);
createAudioOutput();
pause();
}
AudioLayerWidget::~AudioLayerWidget()
@ -189,8 +187,8 @@ void AudioLayerWidget::loadMedia(QString file)
if (m_currentMedia == file)
return;
if (QFile::exists(file)){
reset();
m_decoder->loadMedia(file);
setInitPosition();
m_currentMedia = file;
fileLoaded(file);
}
@ -275,6 +273,7 @@ void AudioLayerWidget::durationChanged(qint64 dur)
void AudioLayerWidget::play()
{
// reset();
setInitPosition();
m_pullTimer->start(PULL_TIMER_INTERVAL);
m_audioOutput->resume();
@ -311,12 +310,12 @@ void AudioLayerWidget::reset()
m_audioOutput->reset();
m_output = m_audioOutput->start();
Q_CHECK_PTR(m_output);
pause();
// pause();
}
void AudioLayerWidget::setInitPosition()
{
// m_buffer.clear();
reset();
m_decoder->setPos(0);
m_progressMs = 0;
m_progressTime->setTime(QTime::fromMSecsSinceStartOfDay(m_progressMs));

View file

@ -5,7 +5,7 @@
#define COPYRIGHT "(C) 2014 Santi Norena libremediaserver@gmail.com"
#define LICENSE "GPL 3 License. See LICENSE.txt and credits.txt for details"
#define LAYERS_NUMBER 4
#define LAYERS_NUMBER 3
#define DEFAULT_FILE "lms-audio.xlm"