celluloid-player / celluloid

A simple GTK+ frontend for mpv
https://celluloid-player.github.io
GNU General Public License v3.0
1.16k stars 92 forks source link

Playback position not always saved when closing window via close button #981

Open FusionGold opened 2 months ago

FusionGold commented 2 months ago

Overview Description: When using an external MPV configuration with save-position-on-quit = yes, the video playback position is consistently saved when quitting with the q key. However, when closing the window by clicking the "close" button, the playback position is not always saved.

Steps to Reproduce:

  1. Open a video with save-position-on-quit = yes enabled in external mpv config file.
  2. Click to seek to a specific position in the video.
  3. Close the window using the "close" button instead of the q key.

Actual Results: Playback position is not always saved when closing the window using the "close" button.

Expected Results: Playback position should be saved consistently when closing the window, just as it is when quitting with the q key.

Version: 0.27 (installed via Arch's extra repo)

Additional Information: Running Arch Linux, GNOME.

gnome-mpv commented 2 months ago

Would you be able to test with the git version? I think this might have been fixed already.

FusionGold commented 2 months ago

Thank you for your response. I installed the celluloid-git package from AUR, version 0.27.r35.g8356432-1, but unfortunately, the issue still persists.

FusionGold commented 1 month ago

Dear dev, I'm afraid the issue has not been resolved. I tested with 3f2aef9 (installed via celluloid-git), but the problem still persists. For test, I used a single line configuration in my mpv.conf that is save-position-on-quit = yes and did choose the file correctly. Disable loading of file and add --save-position-on-quit in the Extra MPV Options UI also not working.

gnome-mpv commented 1 month ago

Can you try reproducing the bug again with logging enabled and post the log file here?

FusionGold commented 1 month ago

I have a video file called video_for_test.mkv, and i play it for 3-5 seconds, and then close it. For test convenient, alias test='rm ~/.config/celluloid/watch_later/*; rm /tmp/celluloid.log;G_MESSAGES_DEBUG=all celluloid video_for_test.mkv --mpv-msg-level=all=trace > /tmp/celluloid.log'

Test with click close button: close_button.log now, do cat ~/.config/celluloid/watch_later/*:

# redirect entry
# redirect entry

Test with press q: q.log now, do cat ~/.config/celluloid/watch_later/*:

# redirect entry
start=3.670000
# redirect entry

Also to mention that this is an occasional issue. I tested by clicking the close button five times, and one time the watch_later recorded the correct position.

Test file with additional stderr message: (not sure if it's helpful.) This time, alias test='rm ~/.config/celluloid/watch_later/*; rm /tmp/celluloid.log;G_MESSAGES_DEBUG=all celluloid video_for_test.mkv --mpv-msg-level=all=trace &> /tmp/celluloid.log'

Test with click close button and redirect stderr: close_button_stderr.log

Test with press q and redirect stderr: q_stderr.log

gnome-mpv commented 1 month ago

Is close_button_stderr.log from when it failed to write a watch_later file?

https://github.com/celluloid-player/celluloid/commit/3f2aef9d829bd99f3db11c000126bf1cccd2fee0 fixed a crash on exit that could prevent the watch_later file from being written, but it doesn't look like there's a crash happening in your log. I'm unable to reproduce the bug with the fix applied.

FusionGold commented 1 month ago

Yes, for the close_button_stderr.log case, I immediately ran cat ~/.config/celluloid/watch_later/*, and it showed # redirect entry # redirect entry with no time logged. It's wired. Not sure if it's an OS specific issue, a Btrfs filesystem problem, or just an isolated case.

FusionGold commented 1 month ago

if it's an OS specific issue

Can confirm no such issue with the flatpak version. The issue only exists when using the celluloid package from arch extra repo, or using celluloid-git from aur.

rthery commented 1 month ago

I'm experiencing the same on 0.27 on a freshly installed Ubuntu 24.10, both with the snap and the ppa:xuzhen666/gnome-mpv versions I have to use q for the position to save, closing with the application with the GUI close button won't save the last position