summaryrefslogtreecommitdiffstats
path: root/audio/out/ao.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-27 11:52:42 +0100
committerwm4 <wm4@nowhere>2014-10-27 11:52:42 +0100
commitd5b081152aecb947215f7b8aa091ca2031c94edc (patch)
treefff6d188ede259a9315489e89396e1b0d5c6b366 /audio/out/ao.c
parentac35e3b308a2469ef49b7094de8b571f054ac2f4 (diff)
downloadmpv-d5b081152aecb947215f7b8aa091ca2031c94edc.tar.bz2
mpv-d5b081152aecb947215f7b8aa091ca2031c94edc.tar.xz
audio: add command/function to reload audio output
Anticipated use: simple solution for dealing with audio APIs which request configuration changes via events.
Diffstat (limited to 'audio/out/ao.c')
-rw-r--r--audio/out/ao.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index ef228780f8..b94e459091 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -29,6 +29,7 @@
#include "audio/format.h"
#include "audio/audio.h"
+#include "input/input.h"
#include "options/options.h"
#include "options/m_config.h"
#include "common/msg.h"
@@ -406,6 +407,13 @@ bool ao_chmap_sel_get_def(struct ao *ao, const struct mp_chmap_sel *s,
return mp_chmap_sel_get_def(s, map, num);
}
+// Request that the player core destroys and recreates the AO.
+void ao_request_reload(struct ao *ao)
+{
+ const char *cmd[] = {"ao_reload", NULL};
+ mp_input_run_cmd(ao->input_ctx, cmd);
+}
+
// --- The following functions just return immutable information.
void ao_get_format(struct ao *ao, struct mp_audio *format)