Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
playback: Don't special-case G_SIGNAL_RUN_CLEANUP stage in signal acc…
…umulators

All these signals don't run the class handler in the CLEANUP stage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1076>
  • Loading branch information
sdroege authored and GStreamer Marge Bot committed Mar 26, 2021
1 parent 0644da8 commit 6bcd6e1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 34 deletions.
15 changes: 5 additions & 10 deletions gst/playback/gstdecodebin2.c
Expand Up @@ -615,8 +615,7 @@ _gst_boolean_accumulator (GSignalInvocationHint * ihint,
gboolean myboolean;

myboolean = g_value_get_boolean (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boolean (return_accu, myboolean);
g_value_set_boolean (return_accu, myboolean);

/* stop emission if FALSE */
return myboolean;
Expand All @@ -632,8 +631,7 @@ _gst_boolean_or_accumulator (GSignalInvocationHint * ihint,
myboolean = g_value_get_boolean (handler_return);
retboolean = g_value_get_boolean (return_accu);

if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boolean (return_accu, myboolean || retboolean);
g_value_set_boolean (return_accu, myboolean || retboolean);

return TRUE;
}
Expand All @@ -646,8 +644,7 @@ _gst_array_accumulator (GSignalInvocationHint * ihint,
gpointer array;

array = g_value_get_boxed (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boxed (return_accu, array);
g_value_set_boxed (return_accu, array);

return FALSE;
}
Expand All @@ -659,8 +656,7 @@ _gst_select_accumulator (GSignalInvocationHint * ihint,
GstAutoplugSelectResult res;

res = g_value_get_enum (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_enum (return_accu, res);
g_value_set_enum (return_accu, res);

/* Call the next handler in the chain (if any) when the current callback
* returns TRY. This makes it possible to register separate autoplug-select
Expand All @@ -679,8 +675,7 @@ _gst_array_hasvalue_accumulator (GSignalInvocationHint * ihint,
gpointer array;

array = g_value_get_boxed (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boxed (return_accu, array);
g_value_set_boxed (return_accu, array);

if (array != NULL)
return FALSE;
Expand Down
3 changes: 1 addition & 2 deletions gst/playback/gstdecodebin3.c
Expand Up @@ -535,8 +535,7 @@ _gst_int_accumulator (GSignalInvocationHint * ihint,
{
gint res = g_value_get_int (handler_return);

if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_int (return_accu, res);
g_value_set_int (return_accu, res);

if (res == -1)
return TRUE;
Expand Down
15 changes: 5 additions & 10 deletions gst/playback/gstparsebin.c
Expand Up @@ -513,8 +513,7 @@ _gst_boolean_accumulator (GSignalInvocationHint * ihint,
gboolean myboolean;

myboolean = g_value_get_boolean (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boolean (return_accu, myboolean);
g_value_set_boolean (return_accu, myboolean);

/* stop emission if FALSE */
return myboolean;
Expand All @@ -530,8 +529,7 @@ _gst_boolean_or_accumulator (GSignalInvocationHint * ihint,
myboolean = g_value_get_boolean (handler_return);
retboolean = g_value_get_boolean (return_accu);

if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boolean (return_accu, myboolean || retboolean);
g_value_set_boolean (return_accu, myboolean || retboolean);

return TRUE;
}
Expand All @@ -544,8 +542,7 @@ _gst_array_accumulator (GSignalInvocationHint * ihint,
gpointer array;

array = g_value_get_boxed (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boxed (return_accu, array);
g_value_set_boxed (return_accu, array);

return FALSE;
}
Expand All @@ -557,8 +554,7 @@ _gst_select_accumulator (GSignalInvocationHint * ihint,
GstAutoplugSelectResult res;

res = g_value_get_enum (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_enum (return_accu, res);
g_value_set_enum (return_accu, res);

/* Call the next handler in the chain (if any) when the current callback
* returns TRY. This makes it possible to register separate autoplug-select
Expand All @@ -577,8 +573,7 @@ _gst_array_hasvalue_accumulator (GSignalInvocationHint * ihint,
gpointer array;

array = g_value_get_boxed (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boxed (return_accu, array);
g_value_set_boxed (return_accu, array);

if (array != NULL)
return FALSE;
Expand Down
15 changes: 5 additions & 10 deletions gst/playback/gsturidecodebin.c
Expand Up @@ -235,8 +235,7 @@ _gst_boolean_accumulator (GSignalInvocationHint * ihint,
gboolean myboolean;

myboolean = g_value_get_boolean (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boolean (return_accu, myboolean);
g_value_set_boolean (return_accu, myboolean);

/* stop emission if FALSE */
return myboolean;
Expand All @@ -252,8 +251,7 @@ _gst_boolean_or_accumulator (GSignalInvocationHint * ihint,
myboolean = g_value_get_boolean (handler_return);
retboolean = g_value_get_boolean (return_accu);

if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boolean (return_accu, myboolean || retboolean);
g_value_set_boolean (return_accu, myboolean || retboolean);

return TRUE;
}
Expand All @@ -265,8 +263,7 @@ _gst_array_accumulator (GSignalInvocationHint * ihint,
gpointer array;

array = g_value_get_boxed (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boxed (return_accu, array);
g_value_set_boxed (return_accu, array);

return FALSE;
}
Expand All @@ -278,8 +275,7 @@ _gst_select_accumulator (GSignalInvocationHint * ihint,
GstAutoplugSelectResult res;

res = g_value_get_enum (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_enum (return_accu, res);
g_value_set_enum (return_accu, res);

/* Call the next handler in the chain (if any) when the current callback
* returns TRY. This makes it possible to register separate autoplug-select
Expand All @@ -298,8 +294,7 @@ _gst_array_hasvalue_accumulator (GSignalInvocationHint * ihint,
gpointer array;

array = g_value_get_boxed (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boxed (return_accu, array);
g_value_set_boxed (return_accu, array);

if (array != NULL)
return FALSE;
Expand Down
3 changes: 1 addition & 2 deletions gst/playback/gsturidecodebin3.c
Expand Up @@ -360,8 +360,7 @@ _gst_int_accumulator (GSignalInvocationHint * ihint,
{
gint res = g_value_get_int (handler_return);

if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_int (return_accu, res);
g_value_set_int (return_accu, res);

if (res == -1)
return TRUE;
Expand Down

0 comments on commit 6bcd6e1

Please sign in to comment.