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

Assertion `mpctx->stop_play' failed when playlist contains --play-dir=- then change to --play-dir=+ #10782

Closed
digitalsignalperson opened this issue Oct 24, 2022 · 0 comments
Labels

Comments

@digitalsignalperson
Copy link

Important Information

Provide following Information:

  • mpv version = 1:0.34.1-5 according to pacman -Q --info mpv, 0.34.1-dirty according to mpv --version
  • Linux Distribution and Version = arch linux, 5.15.73-1-lts
  • Source of the mpv binary = pacman
  • If known which version of mpv introduced the problem = n/a
  • Window Manager and version = kde plasma 5.26.0
  • GPU driver and version = nvidia 520.56.06
  • Possible screenshot or video of visual glitches = n/a

Reproduction steps

The goal is to create a playlist with ping pong loop, play the video forwards, then backwards, etc.

When --play-dir=- is specified for a single item in the playlist, any next item in the playlist with positive play direction causes as crash with this assertion error:

mpv: ../player/loadfile.c:1785: play_current_file: Assertion `mpctx->stop_play' failed.

Examples:

  • mpv --loop-playlist video.mp4 --\{ --play-dir=- video.mp4 --\} plays video.mp4 once forward then once backwards then crash with above assertion error
  • mpv --loop-playlist --\{ --play-dir=- video.mp4 --\} video.mp4 plays video.mp4 once backwards then crashes with assertion error
  • mpv --loop-playlist --play-dir=- video.mp4 plays video.mp4 backwards and loops without crashing

Expected behavior

There should not be an assertion error when playing one file backwards then the next file forwards. The video should play in a ping-pong style loop going forwards then reverse, etc.

Actual behavior

There is an assertion error when playing one file backwards then the next file forwards

Log file

output for mpv --loop-playlist --loop-file=no --log-file=output.txt --\{ --play-dir=- video.webm --\} video.webm
https://0x0.st/ox54.txt

Sample files

n/a

Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Aug 10, 2023
This is pretty obscure but if you screw around with the play-dir option
to essentially create a ping-pong loop; mpv will get hit by an assertion
error. What's happening here is that changing the play-dir always
requires a seek. This is handled in player/command along with the other
runtime option changes. However, queue_seek can actually clear the value
of mpctx->stop_play if the file is ending. So while loadfile is
terminating playback and the play-dir gets changed, the value of
mpctx->stop_play gets cleared because of seek. This then hits that
assertion later when mpv tries to finish the file.

The fix is to just add some weird logic to play-dir in player/command.
We have to be sure that mpctx->play_dir matches the new direction
immediately when we get the change so explictly set it here and don't
wait for it later. Secondly, keep the old value of mpctx->stop_play
before the seek and restore it afterwards. This ensures that termination
still happens cleanly and allows the ping-pong loop to work. Fixes mpv-player#10782
Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Aug 10, 2023
This is pretty obscure but if you screw around with the play-dir option
to essentially create a ping-pong loop; mpv will get hit by an assertion
error. What's happening here is that changing the play-dir always
requires a seek. This is handled in player/command along with the other
runtime option changes. However, queue_seek can actually clear the value
of mpctx->stop_play if the file is ending. So while loadfile is
terminating playback and the play-dir gets changed, the value of
mpctx->stop_play gets cleared because of seek. This then hits that
assertion later when mpv tries to finish the file.

The fix is to just add some weird logic to play-dir in player/command.
We have to be sure that mpctx->play_dir matches the new direction
immediately when we get the change so explictly set it here and don't
wait for it later. Secondly, keep the old value of mpctx->stop_play
before the seek and restore it afterwards. This ensures that termination
still happens cleanly and allows the ping-pong loop to work. Fixes mpv-player#10782
Dudemanguy added a commit to Dudemanguy/mpv that referenced this issue Aug 11, 2023
This is pretty obscure but if you screw around with the play-dir option
to essentially create a ping-pong loop; mpv will get hit by an assertion
error. What's happening here is that changing the play-dir always
requires a seek. This is handled in player/command along with the other
runtime option changes. However, queue_seek can actually clear the value
of mpctx->stop_play if the file is ending. So while loadfile is
terminating playback and the play-dir gets changed, the value of
mpctx->stop_play gets cleared because of seek. This then hits that
assertion later when mpv tries to finish the file.

The fix is to just add some weird logic to play-dir in player/command.
We have to be sure that mpctx->play_dir matches the new direction
immediately when we get the change so explictly set it here and don't
wait for it later. Secondly, keep the old value of mpctx->stop_play
before the seek and restore it afterwards. This ensures that termination
still happens cleanly and allows the ping-pong loop to work. Fixes mpv-player#10782
FarisR99 pushed a commit to FarisR99/mpv that referenced this issue Aug 19, 2023
This is pretty obscure but if you screw around with the play-dir option
to essentially create a ping-pong loop; mpv will get hit by an assertion
error. What's happening here is that changing the play-dir always
requires a seek. This is handled in player/command along with the other
runtime option changes. However, queue_seek can actually clear the value
of mpctx->stop_play if the file is ending. So while loadfile is
terminating playback and the play-dir gets changed, the value of
mpctx->stop_play gets cleared because of seek. This then hits that
assertion later when mpv tries to finish the file.

The fix is to just add some weird logic to play-dir in player/command.
We have to be sure that mpctx->play_dir matches the new direction
immediately when we get the change so explictly set it here and don't
wait for it later. Secondly, keep the old value of mpctx->stop_play
before the seek and restore it afterwards. This ensures that termination
still happens cleanly and allows the ping-pong loop to work. Fixes mpv-player#10782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant