mirror of
https://github.com/mpv-player/mpv
synced 2025-04-26 05:09:29 +00:00
libao2: try to identify some audio outputs that have persistent volume
The mplayer frontend (specifically, mixer.c) needs to know this. If the audio output doesn't remember the volume across reinitialization, the frontend will restore the volume settings. There is also the assumption that the volume setting isn't global in this case (i.e. changing it won't change the volume of other applications or annoy the user otherwise). None of these changes have been tested. I'm guessing that ESD and NAS do per-connection non-persistent volume settings.
This commit is contained in:
parent
7187b49148
commit
56c1ab1c62
@ -418,6 +418,8 @@ static int init(int rate, int channels, int format, int flags)
|
|||||||
int res;
|
int res;
|
||||||
if (!InitDirectSound()) return 0;
|
if (!InitDirectSound()) return 0;
|
||||||
|
|
||||||
|
global_ao->no_persistent_volume = true;
|
||||||
|
|
||||||
// ok, now create the buffers
|
// ok, now create the buffers
|
||||||
WAVEFORMATEXTENSIBLE wformat;
|
WAVEFORMATEXTENSIBLE wformat;
|
||||||
DSBUFFERDESC dsbpridesc;
|
DSBUFFERDESC dsbpridesc;
|
||||||
|
@ -164,6 +164,8 @@ static int init(int rate_hz, int channels, int format, int flags)
|
|||||||
float lag_seconds, lag_net = 0., lag_serv;
|
float lag_seconds, lag_net = 0., lag_serv;
|
||||||
struct timeval proto_start, proto_end;
|
struct timeval proto_start, proto_end;
|
||||||
|
|
||||||
|
global_ao->no_persistent_volume = true;
|
||||||
|
|
||||||
if (esd_fd < 0) {
|
if (esd_fd < 0) {
|
||||||
esd_fd = esd_open_sound(server);
|
esd_fd = esd_open_sound(server);
|
||||||
if (esd_fd < 0) {
|
if (esd_fd < 0) {
|
||||||
|
@ -424,6 +424,8 @@ static int init(int rate,int channels,int format,int flags)
|
|||||||
|
|
||||||
(void)flags; /* shut up 'unused parameter' warning */
|
(void)flags; /* shut up 'unused parameter' warning */
|
||||||
|
|
||||||
|
global_ao->no_persistent_volume = true;
|
||||||
|
|
||||||
nas_data=malloc(sizeof(struct ao_nas_data));
|
nas_data=malloc(sizeof(struct ao_nas_data));
|
||||||
memset(nas_data, 0, sizeof(struct ao_nas_data));
|
memset(nas_data, 0, sizeof(struct ao_nas_data));
|
||||||
|
|
||||||
|
@ -108,6 +108,7 @@ static int init(int rate, int channels, int format, int flags) {
|
|||||||
const opt_t subopts[] = {
|
const opt_t subopts[] = {
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
global_ao->no_persistent_volume = true;
|
||||||
if (subopt_parse(ao_subdevice, subopts) != 0) {
|
if (subopt_parse(ao_subdevice, subopts) != 0) {
|
||||||
print_help();
|
print_help();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -135,6 +135,8 @@ static int init(int rate,int channels,int format,int flags){
|
|||||||
/* SDL Audio Specifications */
|
/* SDL Audio Specifications */
|
||||||
SDL_AudioSpec aspec, obtained;
|
SDL_AudioSpec aspec, obtained;
|
||||||
|
|
||||||
|
global_ao->no_persistent_volume = true;
|
||||||
|
|
||||||
/* Allocate ring-buffer memory */
|
/* Allocate ring-buffer memory */
|
||||||
buffer = av_fifo_alloc(BUFFSIZE);
|
buffer = av_fifo_alloc(BUFFSIZE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user