Skip to content

Commit

Permalink
mixausrc: fix double to float conversion warnings (MSVC)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Nov 15, 2024
1 parent c74320b commit 010ad3d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/mixausrc/mixausrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ static void mixstatus_init(struct mixstatus *st, struct aufilt_prm *prm)
stop_ausrc(st);

st->mode = FM_IDLE;
st->minvol = 1.;
st->ausvol = 1.;
st->minvol = 1.0f;
st->ausvol = 1.0f;
st->i_fade = 0;

/* initialize with configured values */
Expand Down Expand Up @@ -440,9 +440,11 @@ static float fade_linear(struct mixstatus *st, enum mixmode dir)
++st->i_fade;

if (dir == FM_FADEIN)
return (st->minvol + factor) > 1. ? 1. : st->minvol + factor;
return (st->minvol + factor) > 1.0f ? 1.0f
: st->minvol + factor;
else
return (1. - factor) < st->minvol ? st->minvol : 1. - factor;
return (1.0f - factor) < st->minvol ? st->minvol
: 1.0f - factor;
}


Expand Down Expand Up @@ -715,7 +717,7 @@ static int start_process(struct mixstatus* st, const char *name,
st->ausvol = pl_isset(&pl4) ? conv_volume(&pl4) : 1.;
st->i_fade = 0;
st->n_fade = (DEFAULT_FADE_TIME * st->ausrc_prm.srate) / 1000;
st->delta_fade = (1.0 - st->minvol) / st->n_fade;
st->delta_fade = (1.0f - st->minvol) / st->n_fade;

stop_ausrc(st);
ausrc_prm_aufilt(&st->ausrc_prm, &st->prm);
Expand Down

0 comments on commit 010ad3d

Please sign in to comment.