From ab841287a7e1a3783f2e37b18730b028dbdfcfd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 16 Jun 2006 15:17:44 +0000 Subject: gst/audioresample/gstaudioresample.c: Implement GstBaseTransform::start and ::stop so that audioresample can clear it... Original commit message from CVS: * gst/audioresample/gstaudioresample.c: (gst_audioresample_class_init), (gst_audioresample_init), (audioresample_start), (audioresample_stop), (gst_audioresample_set_property), (gst_audioresample_get_property): Implement GstBaseTransform::start and ::stop so that audioresample can clear its internal state properly and be reused insted of causing non-negotiated errors with playbin under some circumstances (#342789). * tests/check/elements/audioresample.c: (setup_audioresample), (cleanup_audioresample): Need to set element state here so that ::start and ::stop are called. --- tests/check/elements/audioresample.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/check/elements') diff --git a/tests/check/elements/audioresample.c b/tests/check/elements/audioresample.c index 3d6a7513..2441530a 100644 --- a/tests/check/elements/audioresample.c +++ b/tests/check/elements/audioresample.c @@ -69,6 +69,10 @@ setup_audioresample (int channels, int inrate, int outrate) "rate", G_TYPE_INT, inrate, NULL); fail_unless (gst_caps_is_fixed (caps)); + fail_unless (gst_element_set_state (audioresample, + GST_STATE_PAUSED) == GST_STATE_CHANGE_SUCCESS, + "could not set to paused"); + mysrcpad = gst_check_setup_src_pad (audioresample, &srctemplate, caps); pad = gst_pad_get_peer (mysrcpad); gst_pad_set_caps (pad, caps); @@ -100,6 +104,9 @@ cleanup_audioresample (GstElement * audioresample) { GST_DEBUG ("cleanup_audioresample"); + fail_unless (gst_element_set_state (audioresample, + GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS, "could not set to NULL"); + gst_check_teardown_src_pad (audioresample); gst_check_teardown_sink_pad (audioresample); gst_check_teardown_element (audioresample); -- cgit v1.2.1