diff options
author | ToZ <tony.paulic@gmail.com> | 2019-03-07 20:55:09 -0300 |
---|---|---|
committer | Andre Miranda <andreldm@xfce.org> | 2019-03-07 20:56:15 -0300 |
commit | 4a5191bb18d7d3ee3c39ac0a95da2f43e1e14b2d (patch) | |
tree | 14f2d6a6eda89749fa35d3f42165b98f530360e0 /plugins/gst-thumbnailer | |
parent | 39f7a7fc0b13c5fe13809de6082d335c042bc632 (diff) | |
download | tumbler-4a5191bb18d7d3ee3c39ac0a95da2f43e1e14b2d.tar.gz |
Add more media types for audio cover thumbnails (Bug #12041)
Diffstat (limited to 'plugins/gst-thumbnailer')
-rw-r--r-- | plugins/gst-thumbnailer/gst-thumbnailer-provider.c | 49 | ||||
-rw-r--r-- | plugins/gst-thumbnailer/gst-thumbnailer.c | 18 |
2 files changed, 58 insertions, 9 deletions
diff --git a/plugins/gst-thumbnailer/gst-thumbnailer-provider.c b/plugins/gst-thumbnailer/gst-thumbnailer-provider.c index 9e077c7..f658110 100644 --- a/plugins/gst-thumbnailer/gst-thumbnailer-provider.c +++ b/plugins/gst-thumbnailer/gst-thumbnailer-provider.c @@ -126,6 +126,55 @@ gst_thumbnailer_provider_get_thumbnailers (TumblerThumbnailerProvider *provider) "application/x-shorten", "application/x-smil", "application/xspf+xml", + "audio/3gpp", + "audio/ac3", + "audio/AMR", + "audio/AMR-WB", + "audio/basic", + "audio/flac", + "audio/midi", + "audio/mp2", + "audio/mp4", + "audio/mpeg", + "audio/mpegurl", + "audio/ogg", + "audio/prs.sid", + "audio/vnd.rn-realaudio", + "audio/x-aiff", + "audio/x-ape", + "audio/x-flac", + "audio/x-gsm", + "audio/x-it", + "audio/x-m4a", + "audio/x-matroska", + "audio/x-mod", + "audio/x-mp3", + "audio/x-mpeg", + "audio/x-mpegurl", + "audio/x-ms-asf", + "audio/x-ms-asx", + "audio/x-ms-wax", + "audio/x-ms-wma", + "audio/x-musepack", + "audio/x-pn-aiff", + "audio/x-pn-au", + "audio/x-pn-realaudio", + "audio/x-pn-realaudio-plugin", + "audio/x-pn-wav", + "audio/x-pn-windows-acm", + "audio/x-realaudio", + "audio/x-real-audio", + "audio/x-s3m", + "audio/x-sbc", + "audio/x-scpls", + "audio/x-speex", + "audio/x-stm", + "audio/x-tta", + "audio/x-wav", + "audio/x-wavpack", + "audio/x-vorbis", + "audio/x-vorbis+ogg", + "audio/x-xm", "image/vnd.rn-realpix", "image/x-pict", "misc/ultravox", diff --git a/plugins/gst-thumbnailer/gst-thumbnailer.c b/plugins/gst-thumbnailer/gst-thumbnailer.c index 73f884b..d080403 100644 --- a/plugins/gst-thumbnailer/gst-thumbnailer.c +++ b/plugins/gst-thumbnailer/gst-thumbnailer.c @@ -138,15 +138,16 @@ gst_thumbnailer_cover_from_tags (GstTagList *tags, { GstSample *cover = NULL; guint i; - GstSample *sample; GstCaps *caps; const GstStructure *caps_struct; - gint type; + gint type = GST_TAG_IMAGE_TYPE_UNDEFINED; GstBuffer *buffer; GdkPixbuf *pixbuf = NULL; for (i = 0; ; i++) { + GstSample *sample; + if (g_cancellable_is_cancelled (cancellable)) break; @@ -161,14 +162,13 @@ gst_thumbnailer_cover_from_tags (GstTagList *tags, GST_TYPE_TAG_IMAGE_TYPE, &type); - if (type == GST_TAG_IMAGE_TYPE_FRONT_COVER) - { - /* found the cover */ - cover = sample; - break; - } + if (cover != NULL) + gst_sample_unref (cover); + cover = sample; - gst_sample_unref (sample); + /* prefer the from cover image if specified */ + if (type == GST_TAG_IMAGE_TYPE_FRONT_COVER) + break; } if (cover == NULL |