1. Add the ability to work back through queued buffers to find the first buffer that’s older than the given one. This is to enable the replacement of deciphered buffers with buffers that arrive later but are timed earlier. Added functions that relate to this are: get_revised_seqno() to wind back through the queued buffers and clear_buffers_from() to free buffers that are already occupied.
2. Clean up get_audio_buffer_size_and_occupancy() and replace it with get_audio_buffer_occupancy(). 3. Add a new general setting: audio_decoded_buffer_desired_length_in_seconds for managing the size of the player buffer queue when the source is buffered audio. Default is 0.75 seconds so that we can step back up to that time if older buffers appear.
This commit is contained in:
@@ -140,10 +140,11 @@ void parse_audio_options(const char *named_stanza, uint32_t default_format_set,
|
||||
/* Get the desired buffer size setting (deprecated). */
|
||||
if (config_lookup_int(config.cfg, "general.audio_backend_buffer_desired_length", &value)) {
|
||||
inform("The setting general.audio_backend_buffer_desired_length is no longer supported. "
|
||||
"Please use alsa.audio_backend_buffer_desired_length_in_seconds instead.");
|
||||
"Please use general.audio_backend_buffer_desired_length_in_seconds instead.");
|
||||
}
|
||||
|
||||
/* Get the desired buffer size setting in seconds. */
|
||||
/* Get the desired backend buffer size setting in seconds. */
|
||||
/* This is the size of the buffer in the output system, e.g. in the DAC itself in ALSA */
|
||||
if (config_lookup_float(config.cfg, "general.audio_backend_buffer_desired_length_in_seconds",
|
||||
&dvalue)) {
|
||||
if (dvalue < 0) {
|
||||
@@ -156,6 +157,21 @@ void parse_audio_options(const char *named_stanza, uint32_t default_format_set,
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the desired decoded buffer size setting in seconds. */
|
||||
/* This is the size of the buffer of decoded and deciphered audio held in the player's output
|
||||
* queue prior to sending it to the output system */
|
||||
if (config_lookup_float(config.cfg, "general.audio_decoded_buffer_desired_length_in_seconds",
|
||||
&dvalue)) {
|
||||
if (dvalue < 0) {
|
||||
die("Invalid audio_decoded_buffer_desired_length_in_seconds value: \"%f\". It "
|
||||
"should be 0.0 or greater."
|
||||
" The default is %.3f seconds",
|
||||
dvalue, config.audio_decoded_buffer_desired_length);
|
||||
} else {
|
||||
config.audio_decoded_buffer_desired_length = dvalue;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the minimum buffer size for fancy interpolation setting in seconds. */
|
||||
if (config_lookup_float(config.cfg,
|
||||
"general.audio_backend_buffer_interpolation_threshold_in_seconds",
|
||||
|
||||
Reference in New Issue
Block a user