diff options
author | wm4 <wm4@nowhere> | 2012-10-30 19:44:09 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-30 20:26:00 +0100 |
commit | ef93036d305ee00394e695bd40672128d13e0136 (patch) | |
tree | 23ccb1df0c2bd9edc5ee657f614ef0f4169856d5 | |
parent | 6403ecdf8794ca920f98133e84bc281647ccc661 (diff) | |
download | mpv-ef93036d305ee00394e695bd40672128d13e0136.tar.bz2 mpv-ef93036d305ee00394e695bd40672128d13e0136.tar.xz |
commands: fix audio-delay property
SET simply didn't set the variable correctly.
Chain the property as generic option, so the property code will return
the correct type for the property, as well as implement the GET part.
-rw-r--r-- | command.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -579,15 +579,17 @@ static int mp_property_audio_delay(m_option_t *prop, int action, { if (!(mpctx->sh_audio && mpctx->sh_video)) return M_PROPERTY_UNAVAILABLE; + float delay = audio_delay; switch (action) { case M_PROPERTY_PRINT: - *(char **)arg = format_delay(audio_delay); + *(char **)arg = format_delay(delay); return M_PROPERTY_OK; case M_PROPERTY_SET: - mpctx->delay -= audio_delay - *(float *)arg; + audio_delay = *(float *)arg; + mpctx->delay -= audio_delay - delay; return M_PROPERTY_OK; } - return M_PROPERTY_NOT_IMPLEMENTED; + return mp_property_generic_option(prop, action, arg, mpctx); } /// Audio codec tag (RO) |