mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +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
sys/osxaudio
|
@ -363,15 +363,12 @@ gst_osx_audio_sink_getcaps (GstBaseSink * sink, GstCaps * filter)
|
||||||
if (buf) {
|
if (buf) {
|
||||||
GST_OBJECT_LOCK (buf);
|
GST_OBJECT_LOCK (buf);
|
||||||
|
|
||||||
if (buf->acquired) {
|
if (buf->acquired && buf->spec.caps) {
|
||||||
/* Caps are fixed, use what we have */
|
/* Caps are fixed, use what we have */
|
||||||
ret = gst_pad_get_current_caps (GST_BASE_SINK_PAD (sink));
|
ret = gst_caps_ref (buf->spec.caps);
|
||||||
if (!ret) {
|
}
|
||||||
GST_OBJECT_UNLOCK (buf);
|
|
||||||
g_return_val_if_reached (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (buf->open && !osxsink->cached_caps) {
|
if (!ret && buf->open && !osxsink->cached_caps) {
|
||||||
/* Device is open, let's probe its caps */
|
/* Device is open, let's probe its caps */
|
||||||
gst_osx_audio_sink_probe_caps (osxsink);
|
gst_osx_audio_sink_probe_caps (osxsink);
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,15 +318,12 @@ gst_osx_audio_src_get_caps (GstBaseSrc * src, GstCaps * filter)
|
||||||
if (buf) {
|
if (buf) {
|
||||||
GST_OBJECT_LOCK (buf);
|
GST_OBJECT_LOCK (buf);
|
||||||
|
|
||||||
if (buf->acquired) {
|
if (buf->acquired && buf->spec.caps) {
|
||||||
/* Caps are fixed, use what we have */
|
/* Caps are fixed, use what we have */
|
||||||
ret = gst_pad_get_current_caps (GST_BASE_SINK_PAD (src));
|
ret = gst_caps_ref (buf->spec.caps);
|
||||||
if (!ret) {
|
}
|
||||||
GST_OBJECT_UNLOCK (buf);
|
|
||||||
g_return_val_if_reached (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (buf->open && !osxsrc->cached_caps) {
|
if (!ret && buf->open && !osxsrc->cached_caps) {
|
||||||
/* Device is open, let's probe its caps */
|
/* Device is open, let's probe its caps */
|
||||||
gst_osx_audio_src_probe_caps (osxsrc);
|
gst_osx_audio_src_probe_caps (osxsrc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue