Use lock & unlock for RDS as well

This commit is contained in:
Clayton Smith 2022-01-20 08:41:25 -05:00
parent dbb565f5b5
commit 3062fe684e
2 changed files with 4 additions and 20 deletions

View File

@ -1363,30 +1363,12 @@ void receiver::get_rds_data(std::string &outbuff, int &num)
void receiver::start_rds_decoder(void)
{
if (d_running)
{
stop();
rx->start_rds_decoder();
start();
}
else
{
rx->start_rds_decoder();
}
rx->start_rds_decoder();
}
void receiver::stop_rds_decoder(void)
{
if (d_running)
{
stop();
rx->stop_rds_decoder();
start();
}
else
{
rx->stop_rds_decoder();
}
rx->stop_rds_decoder();
}
bool receiver::is_rds_decoder_active(void) const

View File

@ -249,10 +249,12 @@ void wfmrx::get_rds_data(std::string &outbuff, int &num)
void wfmrx::start_rds_decoder()
{
lock();
connect(demod_fm, 0, rds, 0);
connect(rds, 0, rds_decoder, 0);
msg_connect(rds_decoder, "out", rds_parser, "in");
msg_connect(rds_parser, "out", rds_store, "store");
unlock();
rds_enabled=true;
}