gst/gstpipeline.c: Do not access variables after they have been deleted.
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Thu, 19 May 2005 12:07:35 +0000 (12:07 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Thu, 19 May 2005 12:07:35 +0000 (12:07 +0000)
Original commit message from CVS:
* gst/gstpipeline.c: (gst_pipeline_send_event):
Do not access variables after they have been deleted.

ChangeLog
gst/gstpipeline.c

index c23a81fe60f1f6b43bb21fa6fd8136db3763e5ad..9d3514c98a785b4e5164e276d455deaadf2a1bbb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-05-19  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
+
+       * gst/gstpipeline.c: (gst_pipeline_send_event):
+         Do not access variables after they have been deleted.
+
 2005-05-19  Wim Taymans  <wim@fluendo.com>
 
        * tools/gst-inspect.c: (print_plugin_features):
index a61db7c18c3aaa9379381d1b0627c72a88aed67c..2bca8361b38fbc9baa0b2a65ae604eac28fcbdea 100644 (file)
@@ -289,6 +289,7 @@ gst_pipeline_send_event (GstElement * element, GstEvent * event)
   gboolean was_playing;
   gboolean res;
   GstElementState state;
+  GstEventType event_type = GST_EVENT_TYPE (event);
 
   /* need to call _get_state() since a bin state is only updated
    * with this call. FIXME, we should probably not block but just
@@ -296,12 +297,12 @@ gst_pipeline_send_event (GstElement * element, GstEvent * event)
   gst_element_get_state (element, &state, NULL, NULL);
   was_playing = state == GST_STATE_PLAYING;
 
-  if (was_playing && GST_EVENT_TYPE (event) == GST_EVENT_SEEK)
+  if (was_playing && event_type == GST_EVENT_SEEK)
     gst_element_set_state (element, GST_STATE_PAUSED);
 
   res = GST_ELEMENT_CLASS (parent_class)->send_event (element, event);
 
-  if (was_playing && GST_EVENT_TYPE (event) == GST_EVENT_SEEK)
+  if (was_playing && event_type == GST_EVENT_SEEK)
     gst_element_set_state (element, GST_STATE_PLAYING);
 
   return res;