vo: always set request_redraw when player is paused#18118
Conversation
This fixes a rare race condition where render_frame clears request_redraw right before the player is paused.
|
Do you have a way to reproduce the race in question? I don't mind if I have to run it a bazillion times to see it. |
|
Load a video with this script and seek a few seconds before the end: function on_eof_reached(name, value) {
if (value == true) {
mp.osd_message("finished watching");
}
}
mp.observe_property("eof-reached", "bool", on_eof_reached); |
|
Hmm not seeing anything. I'm seeking one second from the end and I presume the race would eventually show |
|
The player pauses when the end of playback is reached (with |
|
So the test I'm doing is this with And so far I've seen the message every time. |
|
Right, because seeking causes a redraw. Try this: function on_eof_reached(name, value)
if value == true then
mp.osd_message("finished watching")
mp.add_timeout(1, function()
mp.commandv("seek", "-1", "exact")
mp.set_property("pause", "no")
end)
end
end
mp.observe_property("eof-reached", "bool", on_eof_reached) |
|
Ran that for a few minutes but I still see the message every time. Does that script show the race for you? |
|
It does but not with every video. I can reproduce the race with this one, for instance: https://x.com/mushokutensei_A/status/2062482077174677970 |
This fixes a rare race condition where render_frame clears
request_redraw right before the player is paused.