-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Labels
Comments
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
Important Information
Provide following Information:
pacman -Q --info mpv
, 0.34.1-dirty according tompv --version
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:Examples:
mpv --loop-playlist video.mp4 --\{ --play-dir=- video.mp4 --\}
plays video.mp4 once forward then once backwards then crash with above assertion errormpv --loop-playlist --\{ --play-dir=- video.mp4 --\} video.mp4
plays video.mp4 once backwards then crashes with assertion errormpv --loop-playlist --play-dir=- video.mp4
plays video.mp4 backwards and loops without crashingExpected 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
The text was updated successfully, but these errors were encountered: