From 9e4c173c3c5075eaa1f606cde941c5b3b8f23ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 26 Nov 2024 15:23:02 +0200 Subject: [PATCH] discoverer: Move stream counter from GstDiscovererInfo into GstDiscoverer It's only used temporarily during discovery and makes no sense as part of the resulting info. Part-of: --- .../gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.c | 8 ++++++-- .../gst-libs/gst/pbutils/pbutils-private.h | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.c b/subprojects/gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.c index d3e1c01994..3af719aae4 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/pbutils/gstdiscoverer.c @@ -94,6 +94,7 @@ struct _GstDiscovererPrivate /* current items */ GstDiscovererInfo *current_info; + gint current_info_stream_count; GError *current_error; GstStructure *current_topology; @@ -1277,7 +1278,7 @@ parse_stream_topology (GstDiscoverer * dc, const GstStructure * topology, } if (add_to_list) { - res->stream_number = dc->priv->current_info->stream_count++; + res->stream_number = dc->priv->current_info_stream_count++; dc->priv->current_info->stream_list = g_list_append (dc->priv->current_info->stream_list, res); } else { @@ -1390,6 +1391,7 @@ emit_discovered (GstDiscoverer * dc) /* Clients get a copy of current_info since it is a boxed type */ gst_discoverer_info_unref (dc->priv->current_info); dc->priv->current_info = NULL; + dc->priv->current_info_stream_count = 0; } static gboolean @@ -1487,7 +1489,7 @@ discoverer_collect (GstDiscoverer * dc) dc->priv->current_info->live = TRUE; if (dc->priv->current_topology) { - dc->priv->current_info->stream_count = 1; + dc->priv->current_info_stream_count = 1; dc->priv->current_info->stream_info = parse_stream_topology (dc, dc->priv->current_topology, NULL); if (dc->priv->current_info->stream_info) @@ -1911,6 +1913,7 @@ _setup_locked (GstDiscoverer * dc) /* Pop URI off the pending URI list */ dc->priv->current_info = (GstDiscovererInfo *) g_object_new (GST_TYPE_DISCOVERER_INFO, NULL); + dc->priv->current_info_stream_count = 0; if (dc->priv->use_cache) dc->priv->current_info->cachefile = _serialized_info_get_path (dc, uri); dc->priv->current_info->uri = uri; @@ -1979,6 +1982,7 @@ discoverer_cleanup (GstDiscoverer * dc) } dc->priv->current_info = NULL; + dc->priv->current_info_stream_count = 0; if (dc->priv->all_tags) { gst_tag_list_unref (dc->priv->all_tags); diff --git a/subprojects/gst-plugins-base/gst-libs/gst/pbutils/pbutils-private.h b/subprojects/gst-plugins-base/gst-libs/gst/pbutils/pbutils-private.h index 4a10167b95..42b1b5530f 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/pbutils/pbutils-private.h +++ b/subprojects/gst-plugins-base/gst-libs/gst/pbutils/pbutils-private.h @@ -98,8 +98,6 @@ struct _GstDiscovererInfo { gboolean seekable; GPtrArray *missing_elements_details; - gint stream_count; - gchar *cachefile; gpointer from_cache; };