1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-09-15 13:07:55 -04:00

DATV demod: stop player before initializing DATV framework

This commit is contained in:
f4exb 2021-04-09 13:43:02 +02:00
parent fcbb383978
commit 4f9fe7b533
2 changed files with 11 additions and 1 deletions

View File

@ -22,6 +22,7 @@
#include <QDebug>
#include <QObject>
#include <QFileInfo>
#include <QMutexLocker>
#include "audio/audiooutputdevice.h"
#include "dsp/dspengine.h"
@ -49,7 +50,8 @@ DATVDemodSink::DATVDemodSink() :
m_modcodCodeRate(-1),
m_enmModulation(DATVDemodSettings::BPSK /*DATV_FM1*/),
m_channelSampleRate(1024000),
m_messageQueueToGUI(nullptr)
m_messageQueueToGUI(nullptr),
m_mutex(QMutex::Recursive)
{
//*************** DATV PARAMETERS ***************
m_blnInitialized=false;
@ -155,6 +157,8 @@ bool DATVDemodSink::videoDecodeOK()
bool DATVDemodSink::playVideo()
{
QMutexLocker mlock(&m_mutex);
if (m_objVideoStream == nullptr) {
return false;
}
@ -1283,6 +1287,9 @@ void DATVDemodSink::feed(const SampleVector::const_iterator& begin, const Sample
//********** init leandvb framework **********
if (m_blnNeedConfigUpdate)
{
QMutexLocker mlock(&m_mutex);
stopVideo();
qDebug("DATVDemodSink::feed: Settings applied. Standard : %d...", m_settings.m_standard);
m_blnNeedConfigUpdate = false;

View File

@ -18,6 +18,8 @@
#ifndef INCLUDE_DATVDEMODSINK_H
#define INCLUDE_DATVDEMODSINK_H
#include <QMutex>
//LeanSDR
#include "leansdr/framework.h"
#include "leansdr/generic.h"
@ -317,6 +319,7 @@ private:
MovingAverageUtil<double, double, 32> m_objMagSqAverage;
MessageQueue *m_messageQueueToGUI;
QMutex m_mutex;
static const unsigned int m_rfFilterFftLength;
};