wtay gstreamer: gstreamer/ gstreamer/plugins/elements/

[email protected] Mon, 8 Dec 2008 14:28:19 -0800 (PST)
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gstreamer
Changes by:     wtay
Date:           Mon Dec 08 2008  22:28:19 UTC

Log message:
* plugins/elements/gsttee.c: (gst_tee_handle_buffer):
Check for changed pads-list before checking the last returned
GstFlowReturn because the pad could have been removed and we
need to ignore the value in that case.

Modified files:
    .               : ChangeLog
    plugins/elements: gsttee.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.4183&r2=1.4184
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/plugins/elements/gsttee.c.diff?r1=1.91&r2=1.92

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v
retrieving revision 1.4183
retrieving revision 1.4184
diff -u -d -r1.4183 -r1.4184
--- ChangeLog	8 Dec 2008 18:35:42 -0000	1.4183
+++ ChangeLog	8 Dec 2008 22:28:03 -0000	1.4184
@@ -1,5 +1,12 @@
 2008-12-08  Wim Taymans  <[email protected]>
 
+	* plugins/elements/gsttee.c: (gst_tee_handle_buffer):
+	Check for changed pads-list before checking the last returned
+	GstFlowReturn because the pad could have been removed and we
+	need to ignore the value in that case.
+
+2008-12-08  Wim Taymans  <[email protected]>
 	* libs/gst/base/gstbasetransform.c:
 	(gst_base_transform_prepare_output_buffer),
 	(gst_base_transform_getrange), (gst_base_transform_chain):
Index: gsttee.c
RCS file: /cvs/gstreamer/gstreamer/plugins/elements/gsttee.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- gsttee.c	14 Oct 2008 12:34:55 -0000	1.91
+++ gsttee.c	8 Dec 2008 22:28:05 -0000	1.92
@@ -593,6 +593,18 @@
       GST_LOG_OBJECT (tee, "pad already pushed with %s",
           gst_flow_get_name (ret));
     }
+    /* before we go combining the return value, check if the pad list is still
+     * the same. It could be possible that the pad we just pushed was removed
+     * and the return value it not valid anymore */
+    if (GST_ELEMENT_CAST (tee)->pads_cookie != cookie) {
+      GST_LOG_OBJECT (tee, "pad list changed");
+      /* the list of pads changed, restart iteration. Pads that we already
+       * pushed on and are still in the new list, will not be pushed on
+       * again. */
+      goto restart;
+    }
     /* stop pushing more buffers when we have a fatal error */
     if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED)
       goto error;
@@ -602,14 +614,6 @@
       GST_LOG_OBJECT (tee, "Replacing ret val %d with %d", cret, ret);
       cret = ret;
-
-    if (GST_ELEMENT_CAST (tee)->pads_cookie != cookie) {
-      GST_LOG_OBJECT (tee, "pad list changed");
-      /* the list of pads changed, restart iteration. Pads that we already
-       * pushed on and are still in the new list, will not be pushed on
-       * again. */
-      goto restart;
-    }
     pads = g_list_next (pads);
   }
   GST_OBJECT_UNLOCK (tee);

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/