From 4b2276b730c8542649b665aaec187e1c7e3b2612 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Tue, 19 Sep 2023 20:54:40 -0500 Subject: [PATCH] command: stop restarting playback when writing to playlist-pos e9e93b4dbe748cd341a6fbea355e6ba013ada81b added a warning about writing the same value to the playlist-pos property that in the future it would stop restarting playback. Instead, you should use the playlist-play-index command for that. Well go ahead and drop the old deprecated behavior now and do what wm4 wanted this to do: just ignore if the same value is written again. --- DOCS/interface-changes.rst | 2 ++ DOCS/man/input.rst | 7 +++---- player/command.c | 7 ++----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 2c2681b833..3037e9a46c 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -79,6 +79,8 @@ Interface changes - remove deprecated `drop-frame-count` and `vo-drop-frame-count` property aliases - remove the ability to write to the `display-fps` property (use `override-display-fps` instead) + - writing the current value to playlist-pos will no longer restart playback (use + `playlist-play-index` instead) --- mpv 0.36.0 --- - add `--target-contrast` - Target luminance value is now also applied when ICC profile is used. diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index 9e0e08fff8..0847b64225 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -2772,10 +2772,9 @@ Property list (Before mpv 0.33.0, instead of returning -1, this property was unavailable if no playlist entry was current.) - Writing the current value back to the property is subject to change. - Currently, it will restart playback of the playlist entry. But in the - future, writing the current value will be ignored. Use the - ``playlist-play-index`` command to get guaranteed behavior. + Writing the current value back to the property will have no effect. + Use ``playlist-play-index`` to restart the playback of the current entry if + desired. ``playlist-pos-1`` (RW) Same as ``playlist-pos``, but 1-based. diff --git a/player/command.c b/player/command.c index 0511b1cef5..57341dc39d 100644 --- a/player/command.c +++ b/player/command.c @@ -3037,11 +3037,8 @@ static int mp_property_playlist_pos_x(void *ctx, struct m_property *prop, } case M_PROPERTY_SET: { int pos = *(int *)arg - base; - if (pos >= 0 && playlist_entry_to_index(pl, pl->current) == pos) { - MP_WARN(mpctx, "Behavior of %s when writing the same value will " - "change (currently restarts, it will stop doing this).\n", - prop->name); - } + if (pos >= 0 && playlist_entry_to_index(pl, pl->current) == pos) + return M_PROPERTY_OK; mp_set_playlist_entry(mpctx, playlist_entry_from_index(pl, pos)); return M_PROPERTY_OK; }