2019-09-09 Fred Gleason <fredg@paravelsystems.com>

* Added a 'ServiceTimeout=' directive to the '[Tuning]' section
	of rd.conf(5).
This commit is contained in:
Fred Gleason 2019-09-09 14:56:17 -04:00
parent 7b772ca101
commit c057441daa
6 changed files with 60 additions and 26 deletions

View File

@ -19093,3 +19093,6 @@
* Fixed a regression in rdairplay(1) and rdvairplayd(8) that
caused hard timed events with the 'Start Immediately' attribute
to fail to start if one or more other events were playing.
2019-09-09 Fred Gleason <fredg@paravelsystems.com>
* Added a 'ServiceTimeout=' directive to the '[Tuning]' section
of rd.conf(5).

View File

@ -125,7 +125,12 @@ ChannelsPerPcm=-1
;
[Tuning]
; This section defines the realtime parameters used when running
; This directive tells Rivendell modules how long to wait for the
; 'rivendell' systemd service to become active (seconds). Default
; value is '30'.
ServiceTimeout=30
; These directives define the realtime parameters used when running
; audio components. Normally, these are useful only for debugging.
UseRealtime=Yes
RealtimePriority=9

View File

@ -600,5 +600,9 @@
#define RD_PAD_CLIENT_TCP_PORT 34289
#define RD_PAD_SOURCE_UNIX_ADDRESS "m4w8n8fsfddf-473fdueusurt-8954"
/*
* Default 'ServiceTimeout=' value in rd.conf(5)
*/
#define RD_DEFAULT_SERVICE_TIMEOUT 30
#endif // RD_H

View File

@ -341,6 +341,12 @@ void RDApplication::userChangedData()
bool RDApplication::CheckService(QString *err_msg)
{
bool ret=false;
int trial=config()->serviceTimeout();
if(trial<=0) {
trial=1;
}
while((!ret)&&(trial>0)) {
QStringList args;
QProcess *proc=new QProcess(this);
@ -376,5 +382,9 @@ void RDApplication::userChangedData()
}
delete proc;
trial--;
sleep(1);
}
return ret;
}

View File

@ -417,6 +417,13 @@ int RDConfig::transcodingDelay() const
return conf_transcoding_delay;
}
int RDConfig::serviceTimeout() const
{
return conf_service_timeout;
}
// Don't use this method in application code, use RDTempDirectory()
QString RDConfig::tempDirectory()
{
@ -583,6 +590,8 @@ bool RDConfig::load()
conf_use_realtime=profile->boolValue("Tuning","UseRealtime",false);
conf_realtime_priority=profile->intValue("Tuning","RealtimePriority",9);
conf_transcoding_delay=profile->intValue("Tuning","TranscodingDelay");
conf_service_timeout=
profile->intValue("Tuning","ServiceTimeout",RD_DEFAULT_SERVICE_TIMEOUT);
conf_temp_directory=profile->stringValue("Tuning","TempDirectory","");
conf_sas_station=profile->stringValue("SASFilter","Station","");
conf_sas_matrix=profile->intValue("SASFilter","Matrix",0);
@ -681,6 +690,7 @@ void RDConfig::clear()
conf_use_realtime=false;
conf_realtime_priority=9;
conf_transcoding_delay=0;
conf_service_timeout=RD_DEFAULT_SERVICE_TIMEOUT;
conf_temp_directory="";
conf_sas_station="";
conf_sas_matrix=-1;

View File

@ -106,6 +106,7 @@ class RDConfig
bool useRealtime();
int realtimePriority();
int transcodingDelay() const;
int serviceTimeout() const;
QString tempDirectory();
QString sasStation() const;
int sasMatrix() const;
@ -172,6 +173,7 @@ class RDConfig
bool conf_use_realtime;
int conf_transcoding_delay;
int conf_realtime_priority;
int conf_service_timeout;
QString conf_temp_directory;
QString conf_sas_station;
int conf_sas_matrix;