mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36:38 +00:00
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.
This commit is contained in:
parent
ee2418effd
commit
c57bb51c03
1 changed files with 1 additions and 2 deletions
|
@ -77,7 +77,6 @@ gst_audio_decoder_tester_set_format (GstAudioDecoder * dec, GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstAudioDecoderTester *tester = (GstAudioDecoderTester *) dec;
|
GstAudioDecoderTester *tester = (GstAudioDecoderTester *) dec;
|
||||||
GstAudioInfo info;
|
GstAudioInfo info;
|
||||||
gst_caps_unref (caps);
|
|
||||||
|
|
||||||
if (!tester->setoutputformat_on_decoding) {
|
if (!tester->setoutputformat_on_decoding) {
|
||||||
caps = gst_caps_new_simple ("audio/x-raw", "format", G_TYPE_STRING, "S32LE",
|
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,
|
gst_caps_new_simple ("audio/x-test-custom", "channels", G_TYPE_INT, 2,
|
||||||
"rate", G_TYPE_INT, 44100, NULL);
|
"rate", G_TYPE_INT, 44100, NULL);
|
||||||
fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_caps (caps)));
|
fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_caps (caps)));
|
||||||
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NUM_BUFFERS 1000
|
#define NUM_BUFFERS 1000
|
||||||
|
|
Loading…
Reference in a new issue