Skip to content

Commit c0434be

Browse files
committed
Implement workaround for FIB reconfiguration.
It is not a nice solution because it just restarts the decoder which creates a short audio drop.
1 parent 330ee0a commit c0434be

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

src/backend/fib-processor.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,18 @@ void FIBProcessor::FIG0Extension0 (uint8_t *d)
143143

144144
if (changeflag == 0)
145145
return;
146-
// else if (changeflag == 1) {
147-
// std::clog << "fib-processor:" << "Changes in sub channel organization\n") << std::endl;
148-
// std::clog << "fib-processor:" << "cifcount = %d\n", highpart * 250 + lowpart) << std::endl;
149-
// std::clog << "fib-processor:" << "Change happening in %d CIFs\n", occurrenceChange) << std::endl;
150-
// }
151-
// else if (changeflag == 3) {
152-
// std::clog << "fib-processor:" << "Changes in subchannel and service organization\n") << std::endl;
153-
// std::clog << "fib-processor:" << "cifcount = %d\n", highpart * 250 + lowpart) << std::endl;
154-
// std::clog << "fib-processor:" << "Change happening in %d CIFs\n", occurrenceChange) << std::endl;
155-
// }
156-
std::clog << "fib-processor: " << "changes in config not supported, choose again" << std::endl;
146+
else if (changeflag == 1) {
147+
std::clog << "fib-processor:" << "Changes in sub channel organization" << std::endl;
148+
std::clog << "fib-processor:" << "cifcount = " << highpart * 250 + lowpart << std::endl;
149+
std::clog << "fib-processor:" << "Change happening in " << occurrenceChange << " CIFs" << std::endl;
150+
}
151+
else if (changeflag == 3) {
152+
std::clog << "fib-processor:" << "Changes in subchannel and service organization" << std::endl;
153+
std::clog << "fib-processor:" << "cifcount = " << highpart * 250 + lowpart << std::endl;
154+
std::clog << "fib-processor:" << "Change happening in " << occurrenceChange << " CIFs" << std::endl;
155+
}
156+
157+
myRadioInterface.onRestartService();
157158
}
158159

159160
// FIG0 extension 1 creates a mapping between the

src/backend/radio-controller.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ class RadioControllerInterface {
130130

131131
/* The receiver has shutdown due to a failure in the input device */
132132
virtual void onInputFailure(void) { };
133+
134+
/* The receiver has to restart due RAW file restart or FIB configuration change*/
135+
virtual void onRestartService(void) { };
133136
};
134137

135138
/* A Programme Handler is associated to each tuned programme in the ensemble.

src/welle-gui/radio_controller.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ CRadioController::CRadioController(QVariantMap& commandLineOptions, QObject *par
105105
qRegisterMetaType<dab_date_time_t>("dab_date_time_t");
106106
connect(this, &CRadioController::dateTimeUpdated,
107107
this, &CRadioController::displayDateTime);
108+
109+
connect(this, &CRadioController::restartServiceRequested,
110+
this, &CRadioController::restartService);
108111
}
109112

110113
CRadioController::~CRadioController()
@@ -1121,3 +1124,13 @@ void CRadioController::onInputFailure()
11211124
{
11221125
stop();
11231126
}
1127+
1128+
void CRadioController::onRestartService()
1129+
{
1130+
emit restartServiceRequested();
1131+
}
1132+
1133+
void CRadioController::restartService(void)
1134+
{
1135+
setService(currentService, true);
1136+
}

src/welle-gui/radio_controller.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ class CRadioController :
158158
virtual void onTIIMeasurement(tii_measurement_t&& m) override;
159159
virtual void onMessage(message_level_t level, const std::string& text, const std::string& text2 = std::string()) override;
160160
virtual void onInputFailure(void) override;
161+
virtual void onRestartService(void) override;
161162

162163
private:
163164
void initialise(void);
@@ -246,6 +247,7 @@ private slots:
246247
void channelTimerTimeout(void);
247248
void nextChannel(bool isWait);
248249
void displayDateTime(const dab_date_time_t& dateTime);
250+
void restartService(void);
249251

250252
signals:
251253
void switchToNextChannel(bool isWait);
@@ -282,6 +284,7 @@ private slots:
282284
void volumeChanged(qreal volume);
283285
void motChanged(mot_file_t);
284286
void motReseted(void);
287+
void restartServiceRequested(void);
285288

286289
void channelChanged();
287290
void lastChannelChanged();

0 commit comments

Comments
 (0)