discoverer: Fix accumulating discoverer info when loading from cache
With the previous accumualator loading stopped after the first handler, even if it return NULL which is unexpected, instead we want to use the first non-value returned by handlers. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5665>
This commit is contained in:
parent
23a4b72631
commit
a2bb04c899
@ -219,6 +219,21 @@ static GstDiscovererStreamInfo *_parse_discovery (GVariant * variant,
|
||||
static GstDiscovererInfo *load_serialized_info (GstDiscoverer * dc,
|
||||
gchar * uri);
|
||||
|
||||
static gboolean
|
||||
_gst_discoverer_info_accumulator (GSignalInvocationHint * ihint,
|
||||
GValue * return_accu, const GValue * handler_return, gpointer dummy)
|
||||
{
|
||||
GstDiscovererInfo *info;
|
||||
|
||||
info = g_value_get_object (handler_return);
|
||||
GST_DEBUG ("got discoverer info %" GST_PTR_FORMAT, info);
|
||||
|
||||
g_value_set_object (return_accu, info);
|
||||
|
||||
/* stop emission if we have a discoverer info */
|
||||
return (info == NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_discoverer_class_init (GstDiscovererClass * klass)
|
||||
{
|
||||
@ -346,7 +361,7 @@ gst_discoverer_class_init (GstDiscovererClass * klass)
|
||||
gst_discoverer_signals[SIGNAL_LOAD_SERIALIZED_INFO] =
|
||||
g_signal_new ("load-serialized-info", G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstDiscovererClass,
|
||||
load_serialize_info), g_signal_accumulator_first_wins, NULL, NULL,
|
||||
load_serialize_info), _gst_discoverer_info_accumulator, NULL, NULL,
|
||||
GST_TYPE_DISCOVERER_INFO, 1, G_TYPE_STRING);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user