From fd25ef137edf845bc87d1827b507798f87e96363 Mon Sep 17 00:00:00 2001 From: Ilya Konstantinov Date: Sat, 21 Feb 2015 14:41:08 +0200 Subject: [PATCH] osxaudiosink: Allow renegotiating caps Once osxaudiosink's device is open, it fixates on the initial caps and refuses to accept new caps. This is erroneous since the Audio Unit is can accept a new ASBD, and GstAudioRingBuffer supports reconfiguration as well. https://bugzilla.gnome.org/show_bug.cgi?id=743925 --- sys/osxaudio/gstosxaudiosink.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/osxaudio/gstosxaudiosink.c b/sys/osxaudio/gstosxaudiosink.c index bd373fa..23f0982 100644 --- a/sys/osxaudio/gstosxaudiosink.c +++ b/sys/osxaudio/gstosxaudiosink.c @@ -363,17 +363,12 @@ gst_osx_audio_sink_getcaps (GstBaseSink * sink, GstCaps * filter) if (buf) { GST_OBJECT_LOCK (buf); - if (buf->acquired && buf->spec.caps) { - /* Caps are fixed, use what we have */ - ret = gst_caps_ref (buf->spec.caps); - } - - if (!ret && buf->open && !osxsink->cached_caps) { + if (buf->open && !osxsink->cached_caps) { /* Device is open, let's probe its caps */ gst_osx_audio_sink_probe_caps (osxsink); } - if (!ret && osxsink->cached_caps) + if (osxsink->cached_caps) ret = gst_caps_ref (osxsink->cached_caps); GST_OBJECT_UNLOCK (buf); @@ -381,7 +376,10 @@ gst_osx_audio_sink_getcaps (GstBaseSink * sink, GstCaps * filter) gst_object_unref (buf); } - if (ret && filter) { + if (!ret) + ret = gst_pad_get_pad_template_caps (GST_AUDIO_BASE_SINK_PAD (osxsink)); + + if (filter) { GstCaps *tmp; tmp = gst_caps_intersect_full (filter, ret, GST_CAPS_INTERSECT_FIRST); gst_caps_unref (ret); -- 2.7.4