- [x] I have disclosed use of any AI generated code in my commit
messages.
- If you are using an LLM, and do not fully understand the changes it is
making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex
code that lacks enough context for a proper fix or feature inclusion.
This results in considerably longer code reviews. Due to this, AI
authored or partially authored PRs may be closed without comment.
- [x] I understand these changes in full and will be able to respond to
review comments.
- [x] My change is accurately described in the commit message.
- [x] My contribution is tested and working as described.
- [x] I have read the [Developer Certificate of
Origin](https://developercertificate.org/) and certify my contribution
under its conditions.
Some malformed MP4 files previously wouldn't play at all because they
reported a 0/1 framerate.
Other files suffered from severe audio stuttering caused by repeated
long GAP events emitted from malformed edit lists.
This patch treats invalid framerates as unknown (allowing the existing
fallback to be used) and suppresses suspicious long audio GAP events
before they reach the audio sink.
As a result, both kinds of videos now play correctly.
Add a new button to the controls that defines whether the media repeats
at the end of the stream. The states are:
- Disabled: Media does not repeat. This is existing behavior and the
default state.
- Always: Media always repeats.
- Once: Media repeats once. Flag is reset when loading new media.
Tested all three states with both audio and video.
Added a `rustfmt.toml` to avoid reordering imports. They keep moving
around in previous pull requests, best to just define what we want in
the repository.
Fixes: #39
Closes: #157
XDG portals expose a D-Bus interface allowing apps to prevent screen
idling, user switching, and other actions. That interface,
org.freedesktop.portal.Inhibit, does all of the heavy lifting here.
Idling = the screen dimming or shutting off.
Idling is inhibited when a video is actively playing.
Idling is NOT inhibited when videos aren't playing - this includes
paused or stopped videos.
`lazy_static` and `smol_str` weren't used. COSMIC Player used `dirs`
once to find the user's home directory. Rust fixed and undeprecated its
`home_dir` function in 1.85, which released earlier this year and is the
MSRV of libcosmic.
We hide the title bar similarly on how we hide the controls bar.
The difference between the header bar and the controls bar is that in
`Fullscreen` mode we don't display the header bar even if we have mouse
movement.
If a menu or sub-menu is open, but then the user makes no mouse
movement, then the menus will be hidden when the header bar is hidden.
I'm not sure how to handle the side panel, the `nav_bar`, what I call
"the playlist". I decided to not handle it's hiding based on mouse
movement because it is still displayed when we put the window in
`Fullscreen` mode.
Closes#37
For an executable the first argument is always the binary itself.
Because of this we have to skip it.
If we don't skip it, then it will be treated as another URL, therefore
`cosmic-player` will end up opening two URLs, one for the binary and one
for the actual file we want to play.
When opening multiple files `cosmic-player` will show the side panel /
playlist with the list of files.
The regression this commit fixed was introduced by `01be9152`.
Closes#96.