[tracker-miners/sam/acoustid-fix] Fix confusion between GValue and string
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/sam/acoustid-fix] Fix confusion between GValue and string
- Date: Wed, 24 Jun 2020 19:29:35 +0000 (UTC)
commit bb28f2fe544d36a188a2c28f36edfbd5478b19cd
Author: Sam Thursfield <sam afuera me uk>
Date: Wed Jun 24 21:13:59 2020 +0200
Fix confusion between GValue and string
This error only occurs when building against GStreamer >= 1.17
where GST_TAG_ACOUSTID_FINGERPRINT is defined.
src/tracker-extract/tracker-extract-gstreamer.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index af2153c44..eca6be300 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -628,6 +628,7 @@ extractor_apply_audio_metadata (MetadataExtractor *extractor,
#if defined GST_TAG_ACOUSTID_FINGERPRINT
GValue acoustid_fingerprint = G_VALUE_INIT;
+ gboolean have_acoustid_fingerprint;
#endif
set_property_from_gst_tag (audio, "nmm:trackNumber", tag_list, GST_TAG_TRACK_NUMBER);
@@ -660,16 +661,16 @@ extractor_apply_audio_metadata (MetadataExtractor *extractor,
#endif
#if defined GST_TAG_ACOUSTID_FINGERPRINT
- gst_tag_list_copy_value (&acoustid_fingerprint, tag_list, GST_TAG_ACOUSTID_FINGERPRINT);
- if (acoustid_fingerprint) {
+ have_acoustid_fingerprint = gst_tag_list_copy_value (&acoustid_fingerprint, tag_list,
GST_TAG_ACOUSTID_FINGERPRINT);
+ if (have_acoustid_fingerprint) {
TrackerResource *hash_resource = tracker_resource_new (NULL);
tracker_resource_set_uri (hash_resource, "rdf:type", "nfo:FileHash");
- tracker_resource_set_string (hash_resource, "nfo:hashValue", acoustid_fingerprint);
+ tracker_resource_set_gvalue (hash_resource, "nfo:hashValue", &acoustid_fingerprint);
tracker_resource_set_string (hash_resource, "nfo:hashAlgorithm", "chromaprint");
tracker_resource_add_take_relation (audio, "nfo:hasHash", hash_resource);
- g_free (acoustid_fingerprint);
+ g_value_unset (&acoustid_fingerprint);
}
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]