1
mirror of https://github.com/mpv-player/mpv synced 2024-09-09 01:16:56 +02:00

ao_pulse: fix some volume control rounding issues

Volume could get easily "stuck" or making too huge steps when doing
things like "add ao-volume 1".
This commit is contained in:
wm4 2016-07-14 18:11:14 +02:00
parent f53d73b9dc
commit d191d76e52

View File

@ -23,6 +23,7 @@
#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <math.h>
#include <pthread.h>
#include <pulse/pulseaudio.h>
@ -34,8 +35,8 @@
#include "ao.h"
#include "internal.h"
#define VOL_PA2MP(v) ((v) * 100 / PA_VOLUME_NORM)
#define VOL_MP2PA(v) ((v) * PA_VOLUME_NORM / 100)
#define VOL_PA2MP(v) ((v) * 100.0 / PA_VOLUME_NORM)
#define VOL_MP2PA(v) lrint((v) * PA_VOLUME_NORM / 100)
struct priv {
// PulseAudio playback stream object