libs/gst/base/gstbasetransform.c: Make sure streaming has finished before calling...
authorTim-Philipp Müller <tim@centricular.net>
Sat, 21 Apr 2007 13:27:16 +0000 (13:27 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Sat, 21 Apr 2007 13:27:16 +0000 (13:27 +0000)
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c: (gst_base_transform_activate):
Make sure streaming has finished before calling the ::stop() vfunc,
since that vfunc might clear state which is being used in the
streaming thread. This fixes a race that caused crashes in
audioresample when shutting down a pipeline (#420106).

ChangeLog
libs/gst/base/gstbasetransform.c

index 4899d4c..4a2b6ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-04-21  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * libs/gst/base/gstbasetransform.c: (gst_base_transform_activate):
+         Make sure streaming has finished before calling the ::stop() vfunc,
+         since that vfunc might clear state which is being used in the
+         streaming thread. This fixes a race that caused crashes in
+         audioresample when shutting down a pipeline (#420106).
+
 2007-04-20  Stefan Kost  <ensonic@users.sf.net>
 
        * docs/gst/gstreamer-sections.txt:
index ab8d8b6..f2c10e5 100644 (file)
@@ -1670,6 +1670,11 @@ gst_base_transform_activate (GstBaseTransform * trans, gboolean active)
 
     GST_OBJECT_UNLOCK (trans);
   } else {
+    /* We must make sure streaming has finished before resetting things
+     * and calling the ::stop vfunc */
+    GST_PAD_STREAM_LOCK (trans->sinkpad);
+    GST_PAD_STREAM_UNLOCK (trans->sinkpad);
+
     trans->have_same_caps = FALSE;
     /* We can only reset the passthrough mode if the instance told us to 
        handle it in configure_caps */