mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
decodebin2: use accumulator for autoplug-sort
Use an accumulator for the autoplug-sort signal so that we can stop the emission when a signal handler produced a valid result. This avoids the object handler to overwrite the results from user signals. Fixes #621161
This commit is contained in:
parent
9a971980b7
commit
2cb7cfab19
1 changed files with 19 additions and 2 deletions
|
@ -555,6 +555,22 @@ _gst_select_accumulator (GSignalInvocationHint * ihint,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_gst_array_hasvalue_accumulator (GSignalInvocationHint * ihint,
|
||||
GValue * return_accu, const GValue * handler_return, gpointer dummy)
|
||||
{
|
||||
gpointer array;
|
||||
|
||||
array = g_value_get_boxed (handler_return);
|
||||
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
|
||||
g_value_set_boxed (return_accu, array);
|
||||
|
||||
if (array != NULL)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_decode_bin_class_init (GstDecodeBinClass * klass)
|
||||
{
|
||||
|
@ -681,8 +697,9 @@ gst_decode_bin_class_init (GstDecodeBinClass * klass)
|
|||
gst_decode_bin_signals[SIGNAL_AUTOPLUG_SORT] =
|
||||
g_signal_new ("autoplug-sort", G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstDecodeBinClass, autoplug_sort),
|
||||
NULL, NULL, gst_play_marshal_BOXED__OBJECT_BOXED_BOXED,
|
||||
G_TYPE_VALUE_ARRAY, 3, GST_TYPE_PAD, GST_TYPE_CAPS, G_TYPE_VALUE_ARRAY);
|
||||
_gst_array_hasvalue_accumulator, NULL,
|
||||
gst_play_marshal_BOXED__OBJECT_BOXED_BOXED, G_TYPE_VALUE_ARRAY, 3,
|
||||
GST_TYPE_PAD, GST_TYPE_CAPS, G_TYPE_VALUE_ARRAY);
|
||||
|
||||
/**
|
||||
* GstDecodeBin2::autoplug-select:
|
||||
|
|
Loading…
Reference in a new issue