mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
osxaudio: Directly return the ringbuffer's caps if it is acquired
This commit is contained in:
parent
fc1670b75d
commit
11d6be2dcb
2 changed files with 8 additions and 14 deletions
|
@ -363,15 +363,12 @@ gst_osx_audio_sink_getcaps (GstBaseSink * sink, GstCaps * filter)
|
|||
if (buf) {
|
||||
GST_OBJECT_LOCK (buf);
|
||||
|
||||
if (buf->acquired) {
|
||||
if (buf->acquired && buf->spec.caps) {
|
||||
/* Caps are fixed, use what we have */
|
||||
ret = gst_pad_get_current_caps (GST_BASE_SINK_PAD (sink));
|
||||
if (!ret) {
|
||||
GST_OBJECT_UNLOCK (buf);
|
||||
g_return_val_if_reached (NULL);
|
||||
}
|
||||
ret = gst_caps_ref (buf->spec.caps);
|
||||
}
|
||||
|
||||
} else if (buf->open && !osxsink->cached_caps) {
|
||||
if (!ret && buf->open && !osxsink->cached_caps) {
|
||||
/* Device is open, let's probe its caps */
|
||||
gst_osx_audio_sink_probe_caps (osxsink);
|
||||
}
|
||||
|
|
|
@ -318,15 +318,12 @@ gst_osx_audio_src_get_caps (GstBaseSrc * src, GstCaps * filter)
|
|||
if (buf) {
|
||||
GST_OBJECT_LOCK (buf);
|
||||
|
||||
if (buf->acquired) {
|
||||
if (buf->acquired && buf->spec.caps) {
|
||||
/* Caps are fixed, use what we have */
|
||||
ret = gst_pad_get_current_caps (GST_BASE_SINK_PAD (src));
|
||||
if (!ret) {
|
||||
GST_OBJECT_UNLOCK (buf);
|
||||
g_return_val_if_reached (NULL);
|
||||
}
|
||||
ret = gst_caps_ref (buf->spec.caps);
|
||||
}
|
||||
|
||||
} else if (buf->open && !osxsrc->cached_caps) {
|
||||
if (!ret && buf->open && !osxsrc->cached_caps) {
|
||||
/* Device is open, let's probe its caps */
|
||||
gst_osx_audio_src_probe_caps (osxsrc);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue