From 77bf6d8c0f4982c292b88914c4939b1eec85f592 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 31 Jan 2005 17:39:31 +0000 Subject: [PATCH] gst/gstbin.c: Remove a piece of code that could never be reached. Original commit message from CVS: * gst/gstbin.c: (gst_bin_child_state_change_func): Remove a piece of code that could never be reached. * docs/gst/gstreamer-sections.txt: * gst/gstpad.c: (gst_pad_push), (gst_pad_pull), (gst_pad_call_get_function): * gst/gstpad.h: * testsuite/pad/Makefile.am: Fix #150546, enable tests. --- ChangeLog | 11 +++++++++++ docs/gst/gstreamer-sections.txt | 3 +++ gst/gstbin.c | 2 +- gst/gstpad.c | 9 +++++++++ gst/gstpad.h | 6 ++++++ tests/old/testsuite/pad/Makefile.am | 4 ++-- testsuite/pad/Makefile.am | 4 ++-- 7 files changed, 34 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7ae32a..9f8041d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2005-01-31 Ronald S. Bultje + * gst/gstbin.c: (gst_bin_child_state_change_func): + Remove a piece of code that could never be reached. + * docs/gst/gstreamer-sections.txt: + * gst/gstpad.c: (gst_pad_push), (gst_pad_pull), + (gst_pad_call_get_function): + * gst/gstpad.h: + * testsuite/pad/Makefile.am: + Fix #150546, enable tests. + +2005-01-31 Ronald S. Bultje + * docs/pwg/advanced-types.xml: Fix description for buffer-frames=0. * docs/gst/tmpl/gstbin.sgml: diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index 7a48a91..9931515 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -1272,6 +1272,7 @@ gst_queue_get_type gstrealpad GstRealPad GstRealPad +GstRealPadFlags GST_IS_REAL_PAD_FAST GST_RPAD_DIRECTION GST_RPAD_CAPS @@ -1303,7 +1304,9 @@ GST_IS_REAL_PAD GST_REAL_PAD_CLASS GST_IS_REAL_PAD_CLASS GST_TYPE_REAL_PAD +GST_TYPE_REAL_PAD_FLAGS +gst_real_pad_flags_get_type gst_real_pad_get_type diff --git a/gst/gstbin.c b/gst/gstbin.c index eaa07e1..346e86f 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -705,7 +705,7 @@ gst_bin_child_state_change_func (GstBin * bin, GstElementState oldstate, bin->child_states[new_idx]++; for (i = GST_NUM_STATES - 1; i >= 0; i--) { - if (bin->child_states[i] != 0 || i == 0) { + if (bin->child_states[i] != 0) { gint state = (1 << i); /* We only change state on the parent if the state is not locked. diff --git a/gst/gstpad.c b/gst/gstpad.c index a3f4df8..006f62b 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -3242,6 +3242,8 @@ gst_pad_push (GstPad * pad, GstData * data) g_return_if_fail (GST_IS_PAD (pad)); g_return_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SRC); + g_return_if_fail (!GST_FLAG_IS_SET (GST_PAD_REALIZE (pad), + GST_RPAD_IN_GETFUNC)); g_return_if_fail (data != NULL); DEBUG_DATA (pad, data, "gst_pad_push"); @@ -3318,6 +3320,9 @@ gst_pad_pull (GstPad * pad) g_return_val_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SINK, GST_DATA (gst_event_new (GST_EVENT_INTERRUPT))); + g_return_val_if_fail (!GST_FLAG_IS_SET (GST_PAD_REALIZE (pad), + GST_RPAD_IN_CHAINFUNC), + GST_DATA (gst_event_new (GST_EVENT_INTERRUPT))); peer = GST_RPAD_PEER (pad); @@ -4428,7 +4433,9 @@ gst_pad_get_formats (GstPad * pad) !GST_FLAG_IS_SET (gst_pad_get_parent (pad), GST_ELEMENT_EVENT_AWARE)) { \ gst_pad_send_event (pad, GST_EVENT (__temp)); \ } else { \ + GST_FLAG_SET (pad, GST_RPAD_IN_CHAINFUNC); \ GST_RPAD_CHAINFUNC (pad) (pad, __temp); \ + GST_FLAG_UNSET (pad, GST_RPAD_IN_CHAINFUNC); \ } \ }G_STMT_END /** @@ -4495,7 +4502,9 @@ gst_pad_call_get_function (GstPad * pad) g_return_val_if_fail (GST_PAD_IS_SRC (pad), NULL); g_return_val_if_fail (GST_RPAD_GETFUNC (pad) != NULL, NULL); + GST_FLAG_SET (pad, GST_RPAD_IN_GETFUNC); data = GST_RPAD_GETFUNC (pad) (pad); + GST_FLAG_UNSET (pad, GST_RPAD_IN_GETFUNC); DEBUG_DATA (pad, data, "getfunction returned"); return data; } diff --git a/gst/gstpad.h b/gst/gstpad.h index 944d733..7478768 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -161,6 +161,12 @@ struct _GstPadClass { gpointer _gst_reserved[GST_PADDING]; }; +typedef enum { + GST_RPAD_IN_GETFUNC = GST_PAD_FLAG_LAST, + GST_RPAD_IN_CHAINFUNC, + GST_RPAD_FLAG_LAST = GST_PAD_FLAG_LAST + 4 +} GstRealPadFlags; + struct _GstRealPad { GstPad pad; diff --git a/tests/old/testsuite/pad/Makefile.am b/tests/old/testsuite/pad/Makefile.am index b2f7931..cb6e841 100644 --- a/tests/old/testsuite/pad/Makefile.am +++ b/tests/old/testsuite/pad/Makefile.am @@ -1,5 +1,5 @@ include ../Rules tests_pass = link -tests_fail = -tests_ignore = chainnopull getnopush +tests_fail = chainnopull getnopush +tests_ignore = diff --git a/testsuite/pad/Makefile.am b/testsuite/pad/Makefile.am index b2f7931..cb6e841 100644 --- a/testsuite/pad/Makefile.am +++ b/testsuite/pad/Makefile.am @@ -1,5 +1,5 @@ include ../Rules tests_pass = link -tests_fail = -tests_ignore = chainnopull getnopush +tests_fail = chainnopull getnopush +tests_ignore = -- 2.7.4