[tracker] tracker-extract: Deep copy GstToc



commit e3aa41756b50b788732e3623cd8f2a9c8d795e4c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Nov 19 23:43:21 2016 +0100

    tracker-extract: Deep copy GstToc
    
    According to gst_discoverer_info_get_toc(), it must be deep copied
    if you want to use it past the discoverer info lifetime.

 src/tracker-extract/tracker-extract-gstreamer.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index daa712d..081b89f 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -1151,6 +1151,7 @@ discoverer_init_and_run (MetadataExtractor *extractor,
 {
        GstDiscovererInfo *info;
        const GstTagList *discoverer_tags;
+       const GstToc *gst_toc;
        GError *error = NULL;
        GList *l;
        gchar *required_plugins_message;
@@ -1232,9 +1233,9 @@ discoverer_init_and_run (MetadataExtractor *extractor,
        }
 #endif
 
-       extractor->gst_toc = gst_discoverer_info_get_toc (info);
-       if (extractor->gst_toc)
-               gst_toc_ref (extractor->gst_toc);
+       gst_toc = gst_discoverer_info_get_toc (info);
+       if (gst_toc)
+               extractor->gst_toc = gst_toc_copy (gst_toc);
 
        extractor->duration = gst_discoverer_info_get_duration (info) / GST_SECOND;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]