osxaudioringbuffer: First check the type, then cast

This commit is contained in:
Sebastian Dröge 2013-04-17 09:50:43 +02:00
parent ce5246ed71
commit 2b1f967101

View file

@ -173,7 +173,6 @@ gst_osx_audio_ring_buffer_acquire (GstAudioRingBuffer * buf,
gboolean ret = FALSE, is_passthrough = FALSE;
GstOsxAudioRingBuffer *osxbuf;
AudioStreamBasicDescription format;
GstOsxAudioSink *osxsink;
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,
CORE_AUDIO_FORMAT_ARGS (format));
osxsink = GST_OSX_AUDIO_SINK (GST_OBJECT_PARENT (buf));
if (GST_IS_OSX_AUDIO_SINK (osxsink)) {
if (GST_IS_OSX_AUDIO_SINK (GST_OBJECT_PARENT (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;