diff options
author | Dudemanguy <random342@airmail.cc> | 2024-03-01 09:20:15 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-03-01 09:20:15 -0600 |
commit | 4560d93bf0f2494f4f1344ac1840801911be7319 (patch) | |
tree | f577a83a21356ea4e034d0f5d80fb2fbad48fda5 /player/command.c | |
parent | 8ba6d8f7a9aa3b049b4706e3f26bb614e95f965a (diff) | |
download | mpv-4560d93bf0f2494f4f1344ac1840801911be7319.tar.bz2 mpv-4560d93bf0f2494f4f1344ac1840801911be7319.tar.xz |
Revert "player: add ao-volume option, to set the system volume at startup"
Ended up being a bad idea. As a property, this inherently has more
functionality and the tradeoff of being able to do --ao-volume wasn't
worth it.
This reverts commit 58ed620c064971535e60778612777750aa5e2f4d.
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/player/command.c b/player/command.c index f8fac69ef7..2690fd4a27 100644 --- a/player/command.c +++ b/player/command.c @@ -1681,6 +1681,12 @@ static int mp_property_ao_volume(void *ctx, struct m_property *prop, return M_PROPERTY_NOT_IMPLEMENTED; switch (action) { + case M_PROPERTY_SET: { + float vol = *(float *)arg; + if (ao_control(ao, AOCONTROL_SET_VOLUME, &vol) != CONTROL_OK) + return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_OK; + } case M_PROPERTY_GET: { if (ao_control(ao, AOCONTROL_GET_VOLUME, arg) != CONTROL_OK) return M_PROPERTY_UNAVAILABLE; @@ -3941,7 +3947,7 @@ static const struct m_property mp_properties_base[] = { {"mixer-active", mp_property_mixer_active}, {"volume", mp_property_volume}, {"volume-gain", mp_property_volume_gain}, - {"current-ao-volume", mp_property_ao_volume}, + {"ao-volume", mp_property_ao_volume}, {"ao-mute", mp_property_ao_mute}, {"audio-delay", mp_property_audio_delay}, {"audio-codec-name", mp_property_audio_codec_name}, @@ -4292,8 +4298,8 @@ static const struct property_osd_display { {"volume-gain", "Volume gain", .msg = "Volume gain: ${?volume-gain:${volume-gain} dB ${?mute==yes:(Muted)}}${!volume-gain:${volume-gain}}", .osd_progbar = OSD_VOLUME, .marker = 0}, - {"current-ao-volume", "AO Volume", - .msg = "AO Volume: ${?current-ao-volume:${current-ao-volume}% ${?ao-mute==yes:(Muted)}}${!current-ao-volume:${currene-ao-volume}}", + {"ao-volume", "AO Volume", + .msg = "AO Volume: ${?ao-volume:${ao-volume}% ${?ao-mute==yes:(Muted)}}${!ao-volume:${ao-volume}}", .osd_progbar = OSD_VOLUME, .marker = 100}, {"mute", "Mute"}, {"ao-mute", "AO Mute"}, @@ -7269,9 +7275,6 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, mp_wakeup_core(mpctx); } - if (opt_ptr == &opts->ao_volume) - audio_update_ao_volume(mpctx); - if (flags & UPDATE_HWDEC) { struct track *track = mpctx->current_track[0][STREAM_VIDEO]; struct mp_decoder_wrapper *dec = track ? track->dec : NULL; |