[tracker-miners/wip/carlosg/cue-file-lookups: 4/4] tracker-extract: Fix runtime error




commit 598a7242b9742e8b4eaef71da929c74472f03bc1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Oct 3 13:42:12 2022 +0200

    tracker-extract: Fix runtime error
    
    It seems The gst_discoverer_info_get_stream_info() API call can
    return us a GstDiscovererContainerInfo or a plain
    GstDiscovererStreamInfo. Find out which is it, and use the right
    API to get its tags.
    
    Fixes the following warning seen with some files extracted by
    GStreamer:
    
    tracker-extract-3:25304): GStreamer-PBUtils-CRITICAL **: 13:44:06.792: 
gst_discoverer_container_info_get_tags: assertion 'GST_IS_DISCOVERER_CONTAINER_INFO (info)' failed
    
    Related: https://gitlab.gnome.org/GNOME/tracker/-/issues/378

 src/tracker-extract/tracker-extract-gstreamer.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/tracker-extract/tracker-extract-gstreamer.c b/src/tracker-extract/tracker-extract-gstreamer.c
index 826cc69bb..2eb4734d5 100644
--- a/src/tracker-extract/tracker-extract-gstreamer.c
+++ b/src/tracker-extract/tracker-extract-gstreamer.c
@@ -1249,7 +1249,13 @@ discoverer_init_and_run (MetadataExtractor *extractor,
        /* Retrieve global tags */
 #if defined(HAVE_GSTREAMER_1_20)
        GstDiscovererStreamInfo *sinfo = gst_discoverer_info_get_stream_info (info);
-       discoverer_tags = gst_discoverer_container_info_get_tags ((GstDiscovererContainerInfo *)sinfo);
+
+       if (GST_IS_DISCOVERER_CONTAINER_INFO (sinfo))
+               discoverer_tags = gst_discoverer_container_info_get_tags (GST_DISCOVERER_CONTAINER_INFO 
(sinfo));
+       else if (GST_IS_DISCOVERER_STREAM_INFO (sinfo))
+               discoverer_tags = gst_discoverer_stream_info_get_tags (sinfo);
+       else
+               discoverer_tags = NULL;
 #else
        discoverer_tags = gst_discoverer_info_get_tags (info);
 #endif


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