-
Notifications
You must be signed in to change notification settings - Fork 34
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
add support for embedded cover art #94
Conversation
This adds a dependency on libavformat to extract the cover art. Fixes hoyon#91
mpris.c
Outdated
} | ||
} | ||
if (!packet.size) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is another:
avformat_close_input(&formatContext);
needed here? If so, probably also in the earlier return
case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, thanks. Rewrote the function.
Rewrite try_put_embedded_art to correctly close avformat_input
@gnojus The CI build looks like it's failing. Can you take a look at it? Probably just need to install libavformat in the github actions config. I'm also wondering if we should be caching the art data as the metadata function usually gets called at least twice per file as mpv usually updates the |
Added libavformat-dev to workflow, should pass now. What do you mean by caching - just skip setting of the picture if the code is ran second time? I'm not that familiar with whole mpv/dbus interface thing. |
I mean having a global data structure which stores a mapping between file path and album art url (be it a youtube url, a file path or a jpeg). So that the image file doesn't need to be extracted when the metadata changes. When testing this on my machine the |
@gnojus After this patch, will I didn't yet try rebuilding thanks |
Yes, but it's also a dependency of mpv, so one shouldn't need to install it manually. I could see the argument for lower cpu/ram usage, but that would also work as a runtime flag. |
@hoyon added some basic caching, with the last known path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This adds a dependency on libavformat to extract the cover art.
Fixes #91