mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
volume: Clamp volume to PA_VOLUME_MAX
This ensures that we always clamp the volume to PA_VOLUME_MAX. While this currently has no effect, it will be required for making sure we don't exceed PA_VOLUME_MAX when its value changes in the future.
This commit is contained in:
parent
1d2ef7923d
commit
49101fc540
7 changed files with 24 additions and 19 deletions
|
|
@ -121,6 +121,9 @@ typedef uint32_t pa_volume_t;
|
|||
/** Check if volume is valid. \since 0.9.22 */
|
||||
#define PA_VOLUME_IS_VALID(v) ((v) <= PA_VOLUME_MAX)
|
||||
|
||||
/** Clamp volume to the permitted range. \since 0.9.22 */
|
||||
#define PA_CLAMP_VOLUME(v) (PA_CLAMP_UNLIKELY((v), PA_VOLUME_MUTED, PA_VOLUME_MAX))
|
||||
|
||||
/** A structure encapsulating a per-channel volume */
|
||||
typedef struct pa_cvolume {
|
||||
uint8_t channels; /**< Number of channels */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue