add parent to activate functions
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 18 Nov 2011 12:59:59 +0000 (13:59 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 18 Nov 2011 12:59:59 +0000 (13:59 +0100)
ext/ffmpeg/gstffmpegdemux.c

index 2dcc4f6ed4f7a3cb203f073c7716b0833c158007..22772b1cc9543b00fd8c4ff781a16aee6257dfce 100644 (file)
@@ -126,11 +126,12 @@ static GstFlowReturn gst_ffmpegdemux_chain (GstPad * sinkpad,
     GstObject * parent, GstBuffer * buf);
 
 static void gst_ffmpegdemux_loop (GstFFMpegDemux * demux);
-static gboolean gst_ffmpegdemux_sink_activate (GstPad * sinkpad);
-static gboolean
-gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad, gboolean active);
-static gboolean
-gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active);
+static gboolean gst_ffmpegdemux_sink_activate (GstPad * sinkpad,
+    GstObject * parent);
+static gboolean gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad,
+    GstObject * parent, gboolean active);
+static gboolean gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad,
+    GstObject * parent, gboolean active);
 
 #if 0
 static gboolean
@@ -1690,7 +1691,7 @@ ignore:
 }
 
 static gboolean
-gst_ffmpegdemux_sink_activate (GstPad * sinkpad)
+gst_ffmpegdemux_sink_activate (GstPad * sinkpad, GstObject * parent)
 {
   GstQuery *query;
   gboolean pull_mode;
@@ -1723,12 +1724,13 @@ activate_push:
  * - (independently managed) task driving ffmpeg
  */
 static gboolean
-gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
+gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, GstObject * parent,
+    gboolean active)
 {
   GstFFMpegDemux *demux;
   gboolean res = FALSE;
 
-  demux = (GstFFMpegDemux *) (gst_pad_get_parent (sinkpad));
+  demux = (GstFFMpegDemux *) (parent);
 
   if (active) {
     if (demux->can_push == FALSE) {
@@ -1760,8 +1762,6 @@ gst_ffmpegdemux_sink_activate_push (GstPad * sinkpad, gboolean active)
   }
 
 beach:
-  gst_object_unref (demux);
-
   return res;
 }
 
@@ -1771,12 +1771,13 @@ beach:
  * - task driving ffmpeg based on sink pad
  */
 static gboolean
-gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad, gboolean active)
+gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad, GstObject * parent,
+    gboolean active)
 {
   GstFFMpegDemux *demux;
   gboolean res;
 
-  demux = (GstFFMpegDemux *) (gst_pad_get_parent (sinkpad));
+  demux = (GstFFMpegDemux *) parent;
 
   if (active) {
     demux->seekable = TRUE;
@@ -1787,8 +1788,6 @@ gst_ffmpegdemux_sink_activate_pull (GstPad * sinkpad, gboolean active)
     demux->seekable = FALSE;
   }
 
-  gst_object_unref (demux);
-
   return res;
 }