Change over to times as opposed to frames for setting timing options

This commit is contained in:
Mike Brady
2016-09-04 19:37:22 +01:00
parent 0db88e9029
commit ae84366e8d
8 changed files with 128 additions and 108 deletions
+20 -14
View File
@@ -69,8 +69,9 @@ static int init(int argc, char **argv) {
debug(1, "pipe init");
const char *str;
int value;
config.audio_backend_buffer_desired_length = 44100; // one second.
double dvalue;
config.audio_backend_buffer_desired_length = 1.0;
config.audio_backend_latency_offset = 0;
if (config.cfg != NULL) {
@@ -84,24 +85,29 @@ static int init(int argc, char **argv) {
die("Can't use \"pipe\" backend for STDOUT. Use the \"stdout\" backend instead.");
/* Get the desired buffer size setting. */
if (config_lookup_int(config.cfg, "pipe.audio_backend_buffer_desired_length", &value)) {
if ((value < 0) || (value > 132300))
die("Invalid pipe audio backend buffer desired length \"%d\". It should be between 0 and 132300, default is 44100",
value);
else
config.audio_backend_buffer_desired_length = value;
if (config_lookup_float(config.cfg,
"pipe.audio_backend_buffer_desired_length", &dvalue)) {
if ((dvalue < 0) || (value > 1.5))
die("Invalid pipe audio backend buffer desired length \"%f\". It "
"should be between 0 and "
"1.5, default is 1.0 second",
dvalue);
else {
config.audio_backend_buffer_desired_length = dvalue;
}
}
/* Get the latency offset. */
if (config_lookup_int(config.cfg, "pipe.audio_backend_latency_offset", &value)) {
if ((value < -66150) || (value > 66150))
die("Invalid pipe audio backend buffer latency offset \"%d\". It should be between -66150 and +66150, default is 0",
value);
if (config_lookup_float(config.cfg, "pipe.audio_backend_latency_offset",
&dvalue)) {
if ((dvalue < -1.0) || (value > 1.5))
die("Invalid pipe audio backend buffer latency offset \"%f\". It "
"should be between -1.0 and +1.5, default is 0 seconds",
dvalue);
else
config.audio_backend_latency_offset = value;
config.audio_backend_latency_offset = dvalue;
}
}
if ((pipename == NULL) && (argc != 1))
die("bad or missing argument(s) to pipe");