mirror of
https://github.com/mpv-player/mpv
synced 2025-02-06 07:01:45 +00:00
player: make stop command actually stop
The stop command didn't always stop. In this case, opening a HLS URL and then sending "stop" during loading would actually make it fallback to parsing it as a playlist, and then continued to play the playlist items. (This corner case makes several unfortunate factors come together to produce this really odd behavior.) Another issue is that the "stop" was not always explicitly set. This could be a problem when sending several commands at once. Only the "quit" command should have priority over the "stop" command, so this is still checked.
This commit is contained in:
parent
1c593f1497
commit
ecb776f88e
@ -4588,7 +4588,7 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
|
||||
|
||||
case MP_CMD_STOP:
|
||||
playlist_clear(mpctx->playlist);
|
||||
if (!mpctx->stop_play)
|
||||
if (mpctx->stop_play != PT_QUIT)
|
||||
mpctx->stop_play = PT_STOP;
|
||||
break;
|
||||
|
||||
|
@ -1097,7 +1097,7 @@ reopen_file:
|
||||
}
|
||||
|
||||
open_demux_reentrant(mpctx);
|
||||
if (!mpctx->master_demuxer)
|
||||
if (!mpctx->master_demuxer || mpctx->stop_play)
|
||||
goto terminate_playback;
|
||||
mpctx->demuxer = mpctx->master_demuxer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user