mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-16 17:10:35 +00:00
26 lines
550 B
Text
26 lines
550 B
Text
|
{
|
||
|
guint j;
|
||
|
gint16 vol_i = filter->volume_i;
|
||
|
gfloat vol_f = filter->volume_f;
|
||
|
|
||
|
switch (filter->format) {
|
||
|
case GST_VOLUME_FORMAT_INT:
|
||
|
if (filter->muted) vol_i = 0;
|
||
|
|
||
|
for (j = 0; j < num_samples; j++) {
|
||
|
data[j] = (gint16) (((gint32)vol_i) * ((gint32)data[j]) / 8192);
|
||
|
}
|
||
|
break;
|
||
|
case GST_VOLUME_FORMAT_FLOAT:
|
||
|
if (filter->muted) vol_f = 0;
|
||
|
|
||
|
for (j = 0; j < num_samples; j++) {
|
||
|
data[j] *= vol_f;
|
||
|
}
|
||
|
break;
|
||
|
default:
|
||
|
g_warning("volume: filter.func: no format, aborting");
|
||
|
break;
|
||
|
}
|
||
|
}
|