mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
26.89k stars 2.84k forks source link

player: do not always set mpctx->stop_play when seeking at EOF #14135

Closed Dudemanguy closed 2 months ago

Dudemanguy commented 2 months ago

Normally if you seek during EOF, mpv will reset the value of mpctx->stop_play so it doesn't exit. There's at least a couple of exceptions where this shouldn't happen however. If the play direction changes right at the end of the file, we shouldn't touch the value to avoid an erronous assertion error. Additionally, it is apparently possible for the queue_seek call in VO reinit code to trigger the assertion issue. This is a seek of exactly zero and logically shouldn't be reset mpctx->stop_play anyways (i.e. AT_END_OF_FILE should stay the same). By moving this to queue_seek itself, most of the special handling in player/command.c can be dropped. The option still needs to be set though. Fixes #13778.

@user1121114685: Can you verify if this works for you?

user1121114685 commented 2 months ago

Ok I will try it as soon as possible and give feedback

github-actions[bot] commented 2 months ago

Download the artifacts for this pull request:

Windows * [mpv-i686-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1505810556.zip) * [mpv-x86_64-w64-mingw32](https://nightly.link/mpv-player/mpv/actions/artifacts/1505813204.zip) * [mpv-x86_64-windows-msvc](https://nightly.link/mpv-player/mpv/actions/artifacts/1505852734.zip)
macOS * [mpv-macos-14-arm](https://nightly.link/mpv-player/mpv/actions/artifacts/1505805730.zip) * [mpv-macos-13-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1505809940.zip) * [mpv-macos-12-intel](https://nightly.link/mpv-player/mpv/actions/artifacts/1505819696.zip)
user1121114685 commented 2 months ago

This issue has been resolved, thank you for your efforts.

Dudemanguy commented 2 months ago

Actually I'm not even sure dbdc46c97a32c53d41a19908aa365e7d81025c3e is needed. The assertion in question was added later 8816e1117ee65039dbb5700219ba3537d3e5290e. That assert makes sense to me, but I don't see what usecase the special queue_seek logic has in the first place.

Dudemanguy commented 2 months ago

I made this a full revert instead.

user1121114685 commented 2 months ago

I made this a full revert instead.

After I tested again, the updated pr worked fine in Android libmpv. The problem has been solved

Dudemanguy commented 2 months ago

We'll go with this for now.