summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-05-21 14:02:01 +0200
committerGravatar Christian Hesse <mail@eworm.de>2024-05-21 14:58:31 +0200
commitd692afcff131e6bd5f9ab8ba5bcdf825b8329228 (patch)
treef395624ec45198ea367c006a95a271d2e0e5819f
parent1f70f5866866b03fe6c5d0bd1fea33db7bb99a0d (diff)
downloadmpd-notification-d692afcff131e6bd5f9ab8ba5bcdf825b8329228.tar.gz
mpd-notification-d692afcff131e6bd5f9ab8ba5bcdf825b8329228.tar.zst
accept mime-types for MPEG-4 audio for artwork
Looks like libmagic gives the mime-types 'audio/mp4' and 'audio/x-m4a' for these... Fixes #45
-rw-r--r--mpd-notification.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mpd-notification.c b/mpd-notification.c
index 2e48bb0..fdfa760 100644
--- a/mpd-notification.c
+++ b/mpd-notification.c
@@ -105,7 +105,9 @@ GdkPixbuf * retrieve_artwork(const char * music_dir, const char * uri) {
if (verbose > 0)
printf("%s: MIME type for %s is: %s\n", program, uri_path, magic_mime);
- if (strcmp(magic_mime, "audio/mpeg") != 0)
+ if (strcmp(magic_mime, "audio/mp4") != 0 &&
+ strcmp(magic_mime, "audio/mpeg") != 0 &&
+ strcmp(magic_mime, "audio/x-m4a") != 0)
goto image;
if ((pFormatCtx = avformat_alloc_context()) == NULL) {