--- gstbasesink.org.c	2008-08-19 15:49:56.000000000 +0800
+++ gstbasesink.c	2008-08-19 15:49:56.000000000 +0800
@@ -2208,6 +2208,9 @@
     if (G_LIKELY (event_res)) {
       switch (type) {
         case GST_EVENT_EOS:
+          /* when flushing, after basesink wait-eos cancelled, 
+           * the EOS should be ignored. */
+          if (!basesink->flushing) {
           /* the EOS event is completely handled so we mark
            * ourselves as being in the EOS state. eos is also 
            * protected by the object lock so we can read it when 
@@ -2219,6 +2222,9 @@
           GST_DEBUG_OBJECT (basesink, "Now posting EOS");
           gst_element_post_message (GST_ELEMENT_CAST (basesink),
               gst_message_new_eos (GST_OBJECT_CAST (basesink)));
+          }
+          else
+            GST_DEBUG_OBJECT (basesink, "Ignore EOS during flushing");
           break;
         case GST_EVENT_NEWSEGMENT:
           /* configure the segment */
