diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2014-12-12 17:56:36 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2014-12-12 18:10:54 +0300 |
commit | 44ab108c635e876937eaf9adeb7741f7d23b4055 (patch) | |
tree | 9fff19f956147f3c58355cd780fc59e1ef028663 | |
parent | 943e371a56868b90c0bdfc284792851cf73c9823 (diff) |
tests: audiodecoder: fix broken refcounting in unit test
The set_format vfunc does not pass ownership of the caps
to the decoder, so we mustn't unref the caps there.
gst_event_new_caps() does not take ownership of the caps
passed, so we must unref the caps afterwards.
Fixes leaks when running test in valgrind in 1.4 branch.
-rw-r--r-- | tests/check/libs/audiodecoder.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/check/libs/audiodecoder.c b/tests/check/libs/audiodecoder.c index c2ef4d2ba..934b9ddf9 100644 --- a/tests/check/libs/audiodecoder.c +++ b/tests/check/libs/audiodecoder.c @@ -77,7 +77,6 @@ gst_audio_decoder_tester_set_format (GstAudioDecoder * dec, GstCaps * caps) { GstAudioDecoderTester *tester = (GstAudioDecoderTester *) dec; GstAudioInfo info; - gst_caps_unref (caps); if (!tester->setoutputformat_on_decoding) { caps = gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, "S32LE", @@ -242,7 +241,7 @@ send_startup_events (void) gst_caps_new_simple ("audio/x-test-custom", "channels", G_TYPE_INT, 2, "rate", G_TYPE_INT, 44100, NULL); fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_caps (caps))); - + gst_caps_unref (caps); } #define NUM_BUFFERS 1000 |