Add -Wmissing-declarations -Wmissing-prototypes to warning flags
[platform/upstream/gstreamer.git] / gst / playback / gstplaybin.c
index 298f9e5..f044c61 100644 (file)
 #include <gst/pbutils/pbutils.h>
 
 #include "gstplaybasebin.h"
+#include "gstplayback.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_play_bin_debug);
 #define GST_CAT_DEFAULT gst_play_bin_debug
@@ -414,7 +415,7 @@ gst_play_bin_class_init (GstPlayBinClass * klass)
           "Pango font description of font " "to be used for subtitle rendering",
           NULL, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
 
-  gobject_klass->dispose = GST_DEBUG_FUNCPTR (gst_play_bin_dispose);
+  gobject_klass->dispose = gst_play_bin_dispose;
 
   gst_element_class_set_details (gstelement_klass, &gst_play_bin_details);
 
@@ -1127,7 +1128,7 @@ gen_audio_element (GstPlayBin * play_bin)
   if (volume == NULL)
     goto no_volume;
   g_object_set (G_OBJECT (volume), "volume", play_bin->volume, NULL);
-  play_bin->volume_element = volume;
+  play_bin->volume_element = GST_ELEMENT_CAST (gst_object_ref (volume));
   gst_bin_add (GST_BIN_CAST (element), volume);
 
   res = gst_element_link_pads (conv, "src", scale, "sink");
@@ -1442,6 +1443,11 @@ remove_sinks (GstPlayBin * play_bin)
     gst_object_unref (play_bin->textoverlay_element);
     play_bin->textoverlay_element = NULL;
   }
+
+  if (play_bin->volume_element) {
+    gst_object_unref (play_bin->volume_element);
+    play_bin->volume_element = NULL;
+  }
 }
 
 /* loop over the streams and set up the pipeline to play this