Closed blankname closed 4 years ago
It's possible that this is just treating the symptoms and there's a better solution to the race conditions out there.
I believe it still improves the situation.
I dunno, I've been running with this PR for a while and haven't had any issues even when skipping tracks / seeking quickly. If there's still a race condition, this vastly improves it over my previous attempt to fix it.
EDIT: Literally one minute after posting that, I did get a "thumbnailing failed" error that caused the OSC to disappear. Couldn't get the stdout/stderr dump, unfortunately.
I think the previous error happened when I moved a file to another directory while it was being thumbnailed in the background.
Thanks for trying it out!
It looks like the error in my first screenshot could still happen:
The error occurred when duration became nil in between the check in on_video_change
and a later retrieval shortly afterwards in the get_thumbnail_count
call in update_state
.
I've added a commit to fix that for now 6c88e7c. I will drop b82d752 (since 6c88e7c should be a more complete fix for that issue).
I think we need to try to reduce our calls to retrieve mpv properties (through some sort of caching like what you were doing in your pull) and make sure every property retrieval is checked for nil.
I'll try to look into it more later this weekend.
I created #54 with what I think is a more complete fix for these issues.
I haven't had a ton of time to test yet.
Hope to do so later in the weekend, but I'm out of time for now.
I can drop whatever commits you don't want and/or create a separate pull request for the osc update if you want me to.
I was investigating @Jerrk's comment on #47 and while working on that decided to fix the other similar issues I came across.
They all occurred occasionally while fast-forwarding through many short videos.
b82d752: 75c9f65: 66f87ac: 1b67e22: ccdddb7:
cc:
46
19
https://github.com/TheAMM/mpv_thumbnail_script/issues/47#issuecomment-593175039