summaryrefslogtreecommitdiffstats
path: root/binding/afm-mediaplayer-binding.c
diff options
context:
space:
mode:
Diffstat (limited to 'binding/afm-mediaplayer-binding.c')
-rw-r--r--binding/afm-mediaplayer-binding.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c
index b344917..1c2ce6a 100644
--- a/binding/afm-mediaplayer-binding.c
+++ b/binding/afm-mediaplayer-binding.c
@@ -439,10 +439,10 @@ static void controls(struct afb_req request)
pthread_mutex_unlock(&mutex);
}
-static gchar *get_album_art(GstTagList *tags)
+static GstSample *parse_album(GstTagList *tags, gchar *tag_type)
{
GstSample *sample = NULL;
- int num = gst_tag_list_get_tag_size(tags, GST_TAG_IMAGE);
+ int num = gst_tag_list_get_tag_size(tags, tag_type);
guint i;
for (i = 0; i < num ; i++) {
@@ -450,7 +450,7 @@ static gchar *get_album_art(GstTagList *tags)
GstStructure *caps;
int type;
- value = gst_tag_list_get_value_index(tags, GST_TAG_IMAGE, i);
+ value = gst_tag_list_get_value_index(tags, tag_type, i);
if (value == NULL)
break;
@@ -463,6 +463,17 @@ static gchar *get_album_art(GstTagList *tags)
break;
}
+ return sample;
+}
+
+static gchar *get_album_art(GstTagList *tags)
+{
+ GstSample *sample;
+
+ sample = parse_album(tags, GST_TAG_IMAGE);
+ if (!sample)
+ sample = parse_album(tags, GST_TAG_PREVIEW_IMAGE);
+
if (sample) {
GstBuffer *buffer = gst_sample_get_buffer(sample);
GstMapInfo map;