Fix compilation with -Werror=float-conversion

Better make the conversions explicit so that we don't get any surprises.

Fixes #4065
This commit is contained in:
Wim Taymans 2024-06-18 12:17:56 +02:00
parent 50870aac57
commit 1ae4374ccf
71 changed files with 286 additions and 284 deletions

View file

@ -57,7 +57,7 @@ static void vban_audio_process_playback(void *data)
error = (float)target_buffer - (float)avail;
error = SPA_CLAMP(error, -impl->max_error, impl->max_error);
corr = spa_dll_update(&impl->dll, error);
corr = (float)spa_dll_update(&impl->dll, error);
pw_log_debug("avail:%u target:%u error:%f corr:%f", avail,
target_buffer, error, corr);

View file

@ -358,8 +358,8 @@ struct vban_stream *vban_stream_new(struct pw_core *core,
if (!spa_atof(str, &max_ptime))
max_ptime = DEFAULT_MAX_PTIME;
min_samples = min_ptime * impl->rate / 1000;
max_samples = SPA_MIN(256, max_ptime * impl->rate / 1000);
min_samples = (uint32_t)(min_ptime * impl->rate / 1000);
max_samples = SPA_MIN(256u, (uint32_t)(max_ptime * impl->rate / 1000));
float ptime = 0;
if ((str = pw_properties_get(props, "vban.ptime")) != NULL)
@ -367,7 +367,7 @@ struct vban_stream *vban_stream_new(struct pw_core *core,
ptime = 0.0;
if (ptime) {
impl->psamples = ptime * impl->rate / 1000;
impl->psamples = (uint32_t)(ptime * impl->rate / 1000);
} else {
impl->psamples = impl->mtu / impl->stride;
impl->psamples = SPA_CLAMP(impl->psamples, min_samples, max_samples);