From 9d1fc287e03f6172f0b6c29e5868fdde3d2f026e Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Thu, 8 Mar 2007 18:26:07 +0000 Subject: [PATCH] tests/check/elements/alsa.c: Unref the mixer if the state change fails too (if the alsa devices are inaccessible, for... Original commit message from CVS: * tests/check/elements/alsa.c: (GST_START_TEST): Unref the mixer if the state change fails too (if the alsa devices are inaccessible, for example) --- ChangeLog | 6 ++++++ tests/check/elements/alsa.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4f4bd6dbe7..784609d36a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-03-08 Jan Schmidt + + * tests/check/elements/alsa.c: (GST_START_TEST): + Unref the mixer if the state change fails too (if the + alsa devices are inaccessible, for example) + 2007-03-08 Jan Schmidt * tests/check/Makefile.am: diff --git a/tests/check/elements/alsa.c b/tests/check/elements/alsa.c index c23f7a5469..ddd95c7321 100644 --- a/tests/check/elements/alsa.c +++ b/tests/check/elements/alsa.c @@ -81,8 +81,10 @@ GST_START_TEST (test_alsa_mixer_track) fail_unless (mixer != NULL, "Failed to create 'alsamixer' element!"); state_ret = gst_element_set_state (mixer, GST_STATE_READY); - if (state_ret != GST_STATE_CHANGE_SUCCESS) + if (state_ret != GST_STATE_CHANGE_SUCCESS) { + gst_object_unref (mixer); return; + } GST_LOG ("opened alsamixer"); fail_unless (GST_IS_MIXER (mixer), "is not a GstMixer?!");