Revert "playsinkaudioconvert: Fix warning when there is no target pad yet"
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 3 Nov 2011 08:56:14 +0000 (09:56 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 3 Nov 2011 08:56:14 +0000 (09:56 +0100)
This reverts commit f35c51c14915729f0fdf2b348f351ea7e81027cc.

Better patch coming soon.

gst/playback/gstplaysinkaudioconvert.c

index 2441bfe261c4a8e9bc03fcfc8e951acb907792ef..2c28c6eca0739513e8d8dc640ef9c5a957280fb2 100644 (file)
@@ -348,18 +348,13 @@ gst_play_sink_audio_convert_getcaps (GstPad * pad)
   GstPlaySinkAudioConvert *self =
       GST_PLAY_SINK_AUDIO_CONVERT (gst_pad_get_parent (pad));
   GstCaps *ret;
-  GstPad *otherpad, *peer = NULL;
+  GstPad *otherpad, *peer;
 
   GST_PLAY_SINK_AUDIO_CONVERT_LOCK (self);
   otherpad = gst_ghost_pad_get_target (GST_GHOST_PAD_CAST (pad));
   GST_PLAY_SINK_AUDIO_CONVERT_UNLOCK (self);
 
-  if (otherpad) {
-    peer = gst_pad_get_peer (otherpad);
-    gst_object_unref (otherpad);
-    otherpad = NULL;
-  }
-
+  peer = gst_pad_get_peer (otherpad);
   if (peer) {
     ret = gst_pad_get_caps_reffed (peer);
     gst_object_unref (peer);
@@ -367,6 +362,7 @@ gst_play_sink_audio_convert_getcaps (GstPad * pad)
     ret = gst_caps_new_any ();
   }
 
+  gst_object_unref (otherpad);
   gst_object_unref (self);
 
   return ret;