mirror of https://github.com/mpv-player/mpv
ao_alsa: don't set ALSA message callback
This could output additional, potentially useful error messages. But the callback is global and not library-safe, and would require us to add additional state. Remove it, because it's obviously too much of a pain. Also, it seems ALSA prints stuff to stderr anyway.
This commit is contained in:
parent
ad05e76c57
commit
fdceef6cc5
|
@ -80,25 +80,6 @@ struct priv {
|
|||
static float get_delay(struct ao *ao);
|
||||
static void uninit(struct ao *ao, bool immed);
|
||||
|
||||
static void alsa_error_handler(const char *file, int line, const char *function,
|
||||
int err, const char *format, ...)
|
||||
{
|
||||
char tmp[0xc00];
|
||||
va_list va;
|
||||
|
||||
va_start(va, format);
|
||||
vsnprintf(tmp, sizeof tmp, format, va);
|
||||
va_end(va);
|
||||
|
||||
if (err) {
|
||||
mp_msg(MSGT_AO, MSGL_ERR, "alsa-lib: %s:%i:(%s) %s: %s\n",
|
||||
file, line, function, tmp, snd_strerror(err));
|
||||
} else {
|
||||
mp_msg(MSGT_AO, MSGL_ERR, "alsa-lib: %s:%i:(%s) %s\n",
|
||||
file, line, function, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
/* to set/get/query special features/parameters */
|
||||
static int control(struct ao *ao, enum aocontrol cmd, void *arg)
|
||||
{
|
||||
|
@ -401,7 +382,6 @@ static int init(struct ao *ao)
|
|||
p->can_pause = 1;
|
||||
|
||||
MP_VERBOSE(ao, "using ALSA version: %s\n", snd_asoundlib_version());
|
||||
snd_lib_error_set_handler(alsa_error_handler);
|
||||
|
||||
int open_mode = p->cfg_block ? 0 : SND_PCM_NONBLOCK;
|
||||
//modes = 0, SND_PCM_NONBLOCK, SND_PCM_ASYNC
|
||||
|
@ -573,7 +553,6 @@ static void uninit(struct ao *ao, bool immed)
|
|||
|
||||
alsa_error:
|
||||
p->alsa = NULL;
|
||||
snd_lib_error_set_handler(NULL);
|
||||
}
|
||||
|
||||
static void audio_pause(struct ao *ao)
|
||||
|
|
Loading…
Reference in New Issue