Repository navigation
fix(viewer): release old folder images and prevent playback stalls - #87 - #95
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
Opening an unrelated video folder left decoded images from the previous folder cached. Repeated image/video transitions also exposed a playback deadlock: GTK queried playbin's mute property while a streaming thread held the playsink lock and waited for GTK to initialize the video sink.
Solution:
The sink's main-thread requirement is visible in its Null → Ready implementation. Preparing it before streaming removes the lock cycle instead of suppressing transport queries.
Tests:
cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo test --locked(194 passed; 16 desktop/fixture checks ignored by default),cargo build --release --locked, and diff whitespace checks.vavp8dec, NVIDIAnvvp8dec, and explicitly selected softwarevp8dec. No open-request timeouts; all three oldglycin-framemappings disappeared on every transition to the video folder.Measured release-build process-tree PSS (MiB):
The earlier local base software run retained three old frame mappings and settled at 214.4 / 224.2 / 238.4 MiB across three cycles. The final build retained zero old image mappings in all nine video transitions. Native decoder/renderer allocations still contribute to PSS; cache cleanup does not promise fresh-launch memory usage.
Method: Fedora GNOME/Wayland, optimized build,
GSK_RENDERER=gl, default 256 MiB cache, three 4000×3000 gradient JPEGs, and a 1920×1080/30 VP8 WebM. Each process opens a fresh video, browses a/b/c images, reopens b, and returns to the unrelated video folder three times. Recursive process-tree PSS is sampled approximately every 100 ms, including while forwarding open requests; video settled values are medians of seconds 5–8. Peaks can miss shorter spikes and PSS does not fully account for GPU memory. These are exploratory single runs with three cycles each, not statistical guarantees. The earlier base run sampled after forwarding returned, so its peaks are not directly comparable to the final peaks above.Issue:
Fixes #87
Note:
Implementation and agent-run verification are complete. This remains a draft for author review and personal desktop testing; no installation or merge was performed.
Close any existing instance, then run
./target/release/open-mpv /path/to/media. Review same-folder reopening, repeated image/video switching, volume/mute and playback controls, external image edits, and rotate-save → Trash → Undo. The former repeated-transition deadlock is resolved and is no longer a verification blocker.