mirror of https://github.com/mpv-player/mpv
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:
parent
f53d73b9dc
commit
d191d76e52
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue