mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
osxaudioringbuffer: First check the type, then cast
This commit is contained in:
parent
ce5246ed71
commit
2b1f967101
1 changed files with 2 additions and 4 deletions
|
@ -173,7 +173,6 @@ gst_osx_audio_ring_buffer_acquire (GstAudioRingBuffer * buf,
|
||||||
gboolean ret = FALSE, is_passthrough = FALSE;
|
gboolean ret = FALSE, is_passthrough = FALSE;
|
||||||
GstOsxAudioRingBuffer *osxbuf;
|
GstOsxAudioRingBuffer *osxbuf;
|
||||||
AudioStreamBasicDescription format;
|
AudioStreamBasicDescription format;
|
||||||
GstOsxAudioSink *osxsink;
|
|
||||||
|
|
||||||
osxbuf = GST_OSX_AUDIO_RING_BUFFER (buf);
|
osxbuf = GST_OSX_AUDIO_RING_BUFFER (buf);
|
||||||
|
|
||||||
|
@ -228,10 +227,9 @@ gst_osx_audio_ring_buffer_acquire (GstAudioRingBuffer * buf,
|
||||||
GST_DEBUG_OBJECT (osxbuf, "Format: " CORE_AUDIO_FORMAT,
|
GST_DEBUG_OBJECT (osxbuf, "Format: " CORE_AUDIO_FORMAT,
|
||||||
CORE_AUDIO_FORMAT_ARGS (format));
|
CORE_AUDIO_FORMAT_ARGS (format));
|
||||||
|
|
||||||
osxsink = GST_OSX_AUDIO_SINK (GST_OBJECT_PARENT (buf));
|
if (GST_IS_OSX_AUDIO_SINK (GST_OBJECT_PARENT (buf))) {
|
||||||
if (GST_IS_OSX_AUDIO_SINK (osxsink)) {
|
|
||||||
gst_audio_ring_buffer_set_channel_positions (buf,
|
gst_audio_ring_buffer_set_channel_positions (buf,
|
||||||
osxsink->channel_positions);
|
GST_OSX_AUDIO_SINK (GST_OBJECT_PARENT (buf))->channel_positions);
|
||||||
}
|
}
|
||||||
|
|
||||||
buf->size = spec->segtotal * spec->segsize;
|
buf->size = spec->segtotal * spec->segsize;
|
||||||
|
|
Loading…
Reference in a new issue