mpv/libmpv
wm4 26ac6ead91 player: fix subtle idle mode differences on early program start
If the user manages to run a "loadfile x append" command before the loop
in mp_play_files() is entered, then the player could start playing
these. This isn't expected, because appending files to the playlist in
idle mode does not normally start playback. It could happen because
there is a short time window where commands are processed before the
loop is entered (such as running the command when a script is loaded).

The idle mode semantics are pretty weird: if files were provided in
advance (on the command line), then these should be played immediately.
But if idle mode was already entered, and something is appended to the
playlist using "append", i.e. without explicitly triggering playback,
then it should remain in idle mode.

Try to follow this by redefining PT_STOP to strictly mean idle mode.
Remove the playlist->current check from idle_loop(), since only the
stop_play field counts now (cf. what mp_set_playlist_entry() does).

This actually introduces the possibility that playlist->current, and
with it playlist-pos, are set to something, even though playback is not
active or being started. Previously, this was only possible during state
transitions, such as when changing playlist entries.

Very annoyingly, this means the current way MPV_EVENT_IDLE was sent
doesn't work anymore. Logically, idle mode can be "active" even if
idle_loop() was not entered yet (between the time after mp_initialize()
and before the loop in mp_play_files()). Instead of worrying about this,
redo the "idle-active" property, and deprecate the event.

See: #7543
2020-03-21 19:32:50 +01:00
..
client.h player: fix subtle idle mode differences on early program start 2020-03-21 19:32:50 +01:00
mpv.def client API: add mpv_command_ret 2019-09-21 14:24:42 +02:00
mpv.pc.in
opengl_cb.h drm/atomic: add connector to atomic context 2018-05-01 20:48:02 +03:00
render.h client API: be explicit about usage rules and deadlocks some more 2019-09-26 14:17:00 +02:00
render_gl.h drm: fix libmpv ABI breakage introduced in 351c083487 2019-09-18 23:59:32 +03:00
stream_cb.h stream_cb: add cancel_fn callback 2019-09-27 13:00:45 -07:00