Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 16, 2024

Conversation

Dudemanguy
Copy link
Member

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
Copy link

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

Copy link

github-actions bot commented May 13, 2024

Download the artifacts for this pull request:

Windows
macOS

@user1121114685
Copy link

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

player/playloop.c Outdated Show resolved Hide resolved
@Dudemanguy
Copy link
Member Author

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

In various edge cases, this causes an assertion that was added later in
8816e11 to be hit. The actual purpose
of the special case is not really clear. mp_seek already will change the
mpctx->stop_play value, so there shouldn't be any need to do it in
queue_seek. And it is known to cause problems so revert it. Also, remove
the special play direction logic that works around this behavior.
Fixes mpv-player#13778.

This reverts commit dbdc46c.
@Dudemanguy
Copy link
Member Author

I made this a full revert instead.

@user1121114685
Copy link

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
Copy link
Member Author

We'll go with this for now.

@Dudemanguy Dudemanguy merged commit d59f4fd into mpv-player:master May 16, 2024
18 checks passed
@Dudemanguy Dudemanguy deleted the queue-seek-stop-play branch May 16, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants