summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-27 12:16:32 +0100
committerwm4 <wm4@nowhere>2014-10-27 12:18:25 +0100
commitdced2aa81b5b44e9952c7be8834da441f58187e8 (patch)
tree7570463938e798d118bb3b2687d066abba57eae0 /player/command.c
parentd5b081152aecb947215f7b8aa091ca2031c94edc (diff)
downloadmpv-dced2aa81b5b44e9952c7be8834da441f58187e8.tar.bz2
mpv-dced2aa81b5b44e9952c7be8834da441f58187e8.tar.xz
command: add audio-device property
Meant for changing the --audio-device at runtime.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index a4ef70082c..b28103a954 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1466,6 +1466,16 @@ static void reload_audio_output(struct MPContext *mpctx)
reinit_audio_chain(mpctx);
}
+static int mp_property_audio_device(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ struct MPContext *mpctx = ctx;
+ int r = mp_property_generic_option(mpctx, prop, action, arg);
+ if (action == M_PROPERTY_SET)
+ reload_audio_output(mpctx);
+ return r;
+}
+
static int mp_property_audio_devices(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -3049,6 +3059,7 @@ static const struct m_property mp_properties[] = {
{"aid", mp_property_audio},
{"balance", mp_property_balance},
{"volume-restore-data", mp_property_volrestore},
+ {"audio-device", mp_property_audio_device},
{"audio-device-list", mp_property_audio_devices},
// Video