mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
pulse: clamp channel numbers to right values
When converting between pipewire and pulse channelmaps, make sure we clamp the channel numbers to the the right limit.
This commit is contained in:
parent
722776cf65
commit
a9f12537d1
4 changed files with 20 additions and 18 deletions
|
|
@ -53,7 +53,7 @@ int volume_parse_param(const struct spa_pod *param, struct volume_info *info, bo
|
|||
if (monitor)
|
||||
continue;
|
||||
info->volume.channels = spa_pod_copy_array(&prop->value, SPA_TYPE_Float,
|
||||
info->volume.values, SPA_AUDIO_MAX_CHANNELS);
|
||||
info->volume.values, CHANNELS_MAX);
|
||||
SPA_FLAG_UPDATE(info->flags, VOLUME_HW_VOLUME,
|
||||
prop->flags & SPA_POD_PROP_FLAG_HARDWARE);
|
||||
break;
|
||||
|
|
@ -68,7 +68,7 @@ int volume_parse_param(const struct spa_pod *param, struct volume_info *info, bo
|
|||
if (!monitor)
|
||||
continue;
|
||||
info->volume.channels = spa_pod_copy_array(&prop->value, SPA_TYPE_Float,
|
||||
info->volume.values, SPA_AUDIO_MAX_CHANNELS);
|
||||
info->volume.values, CHANNELS_MAX);
|
||||
SPA_FLAG_CLEAR(info->flags, VOLUME_HW_VOLUME);
|
||||
break;
|
||||
case SPA_PROP_volumeBase:
|
||||
|
|
@ -84,7 +84,7 @@ int volume_parse_param(const struct spa_pod *param, struct volume_info *info, bo
|
|||
}
|
||||
case SPA_PROP_channelMap:
|
||||
info->map.channels = spa_pod_copy_array(&prop->value, SPA_TYPE_Id,
|
||||
info->map.map, SPA_AUDIO_MAX_CHANNELS);
|
||||
info->map.map, CHANNELS_MAX);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue