osxaudioringbuffer: First check the type, then cast
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 17 Apr 2013 07:50:43 +0000 (09:50 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 17 Apr 2013 07:52:14 +0000 (09:52 +0200)
sys/osxaudio/gstosxaudioringbuffer.c

index d904b09..997ae97 100644 (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;