diff options
author | wm4 <wm4@nowhere> | 2014-10-27 12:16:32 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-27 12:18:25 +0100 |
commit | dced2aa81b5b44e9952c7be8834da441f58187e8 (patch) | |
tree | 7570463938e798d118bb3b2687d066abba57eae0 /player | |
parent | d5b081152aecb947215f7b8aa091ca2031c94edc (diff) | |
download | mpv-dced2aa81b5b44e9952c7be8834da441f58187e8.tar.bz2 mpv-dced2aa81b5b44e9952c7be8834da441f58187e8.tar.xz |
command: add audio-device property
Meant for changing the --audio-device at runtime.
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 11 |
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 |