[tracker/tracker-0.16] tracker-extract-gstreamer: Get media art image type from sample info
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.16] tracker-extract-gstreamer: Get media art image type from sample info
- Date: Wed, 31 Jul 2013 22:30:58 +0000 (UTC)
commit dc6b1f01d6a64c2cbedf02134bc70fa5cc0643f1
Author: Arnel A. Borja <arnelborja src gnome org>
Date: Sat Jul 6 22:42:44 2013 +0800
tracker-extract-gstreamer: Get media art image type from sample info
Instead of getting the "image-type" field from the caps of the sample, get
it from the structure for extra information of the sample. Check also that
the field does exists, skipping the sample if it doesn't.
Fixes GB#703747
src/tracker-extract/tracker-extract-gstreamer.c | 43 +++++++++++++----------
1 files changed, 24 insertions(+), 19 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index e8cf903..17f3f61 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -483,28 +483,33 @@ get_embedded_media_art (MetadataExtractor *extractor)
if (have_sample) {
GstBuffer *buffer;
- GstCaps *caps;
- GstStructure *caps_struct;
+ GstStructure *info_struct;
gint type;
buffer = gst_sample_get_buffer (extractor->sample);
- caps = gst_sample_get_caps (extractor->sample);
- caps_struct = gst_caps_get_structure (caps, 0);
- gst_structure_get_enum (caps_struct,
- "image-type",
- GST_TYPE_TAG_IMAGE_TYPE,
- &type);
-
- if (type == GST_TAG_IMAGE_TYPE_FRONT_COVER ||
- (type == GST_TAG_IMAGE_TYPE_UNDEFINED && extractor->media_art_buffer_size == 0)) {
- if (!gst_buffer_map (buffer, &extractor->info, GST_MAP_READ))
- return FALSE;
-
- extractor->media_art_buffer = extractor->info.data;
- extractor->media_art_buffer_size = extractor->info.size;
- extractor->media_art_buffer_mime = gst_structure_get_name (caps_struct);
-
- return TRUE;
+ info_struct = gst_sample_get_info (extractor->sample);
+ if (gst_structure_get_enum (info_struct,
+ "image-type",
+ GST_TYPE_TAG_IMAGE_TYPE,
+ &type)) {
+ if (type == GST_TAG_IMAGE_TYPE_FRONT_COVER ||
+ (type == GST_TAG_IMAGE_TYPE_UNDEFINED &&
+ extractor->media_art_buffer_size == 0)) {
+ GstCaps *caps;
+ GstStructure *caps_struct;
+
+ if (!gst_buffer_map (buffer, &extractor->info, GST_MAP_READ))
+ return FALSE;
+
+ caps = gst_sample_get_caps (extractor->sample);
+ caps_struct = gst_caps_get_structure (caps, 0);
+
+ extractor->media_art_buffer = extractor->info.data;
+ extractor->media_art_buffer_size = extractor->info.size;
+ extractor->media_art_buffer_mime = gst_structure_get_name
(caps_struct);
+
+ return TRUE;
+ }
}
lindex++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]