Index: gst/mpegstream/gstdvddemux.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-ugly/gst/mpegstream/gstdvddemux.c,v
retrieving revision 1.40
diff -u -p -u -p -r1.40 gstdvddemux.c
--- gst/mpegstream/gstdvddemux.c        19 Nov 2006 13:08:30 -0000      1.40
+++ gst/mpegstream/gstdvddemux.c        16 May 2007 12:46:58 -0000
@@ -319,6 +319,10 @@ gst_dvd_demux_process_event (GstMPEGPars
       dvd_demux->segment_filter = TRUE;
       ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse,
           event);
+
+      /* parent class will have reset the other streams */
+      gst_mpeg_streams_reset_last_flow (dvd_demux->subpicture_stream,
+          GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS);
       break;
     case GST_EVENT_CUSTOM_DOWNSTREAM:
     case GST_EVENT_CUSTOM_DOWNSTREAM_OOB:
Index: gst/mpegstream/gstmpegdemux.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-ugly/gst/mpegstream/gstmpegdemux.c,v
retrieving revision 1.93
diff -u -p -u -p -r1.93 gstmpegdemux.c
--- gst/mpegstream/gstmpegdemux.c       19 Nov 2006 13:08:30 -0000      1.93
+++ gst/mpegstream/gstmpegdemux.c       16 May 2007 12:46:59 -0000
@@ -92,6 +92,9 @@ GST_BOILERPLATE_FULL (GstMPEGDemux, gst_
 
 static void gst_mpeg_demux_class_init (GstMPEGDemuxClass * klass);
 
+static gboolean gst_mpeg_demux_process_event (GstMPEGParse * mpeg_parse,
+    GstEvent * event);
+
 static GstPad *gst_mpeg_demux_new_output_pad (GstMPEGDemux * mpeg_demux,
     const gchar * name, GstPadTemplate * temp);
 static void gst_mpeg_demux_init_stream (GstMPEGDemux * mpeg_demux,
@@ -190,6 +193,7 @@ gst_mpeg_demux_class_init (GstMPEGDemuxC
   mpeg_parse_class->parse_packet = gst_mpeg_demux_parse_packet;
   mpeg_parse_class->parse_pes = gst_mpeg_demux_parse_pes;
   mpeg_parse_class->send_buffer = NULL;
+  mpeg_parse_class->process_event = gst_mpeg_demux_process_event;
 
   klass->new_output_pad = gst_mpeg_demux_new_output_pad;
   klass->init_stream = gst_mpeg_demux_init_stream;
@@ -229,6 +233,34 @@ gst_mpeg_demux_init (GstMPEGDemux * mpeg
   mpeg_demux->last_pts = -1;
 }
 
+
+static gboolean
+gst_mpeg_demux_process_event (GstMPEGParse * mpeg_parse, GstEvent * event)
+{
+  GstMPEGDemux *demux = GST_MPEG_DEMUX (mpeg_parse);
+  gboolean ret;
+
+  switch (GST_EVENT_TYPE (event)) {
+    case GST_EVENT_FLUSH_STOP:
+      ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse,
+          event);
+
+      gst_mpeg_streams_reset_last_flow (demux->video_stream,
+          GST_MPEG_DEMUX_NUM_VIDEO_STREAMS);
+      gst_mpeg_streams_reset_last_flow (demux->audio_stream,
+          GST_MPEG_DEMUX_NUM_AUDIO_STREAMS);
+      gst_mpeg_streams_reset_last_flow (demux->private_stream,
+          GST_MPEG_DEMUX_NUM_PRIVATE_STREAMS);
+      break;
+    default:
+      ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse,
+          event);
+      break;
+  }
+
+  return ret;
+}
+
 static gint
 _demux_get_writer_id (GstIndex * index, GstPad * pad)
 {
@@ -1310,6 +1342,16 @@ gst_mpeg_demux_get_index (GstElement * e
   return mpeg_demux->index;
 }
 
+void
+gst_mpeg_streams_reset_last_flow (GstMPEGStream *streams[], guint num)
+{
+  guint i;
+
+  for (i = 0; i < num; ++i) {
+    if (streams[i] != NULL)
+      streams[i]->last_flow = GST_FLOW_OK;
+  }
+}
 
 gboolean
 gst_mpeg_demux_plugin_init (GstPlugin * plugin)
Index: gst/mpegstream/gstmpegdemux.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-ugly/gst/mpegstream/gstmpegdemux.h,v
retrieving revision 1.26
diff -u -p -u -p -r1.26 gstmpegdemux.h
--- gst/mpegstream/gstmpegdemux.h       19 Nov 2006 13:08:30 -0000      1.26
+++ gst/mpegstream/gstmpegdemux.h       16 May 2007 12:46:59 -0000
@@ -204,9 +204,12 @@ struct _GstMPEGDemuxClass {
                                         GstClockTime last_ts);
 };
 
-GType           gst_mpeg_demux_get_type         (void);
+void            gst_mpeg_streams_reset_last_flow (GstMPEGStream *streams[],
+                                                  guint          num);
 
-gboolean        gst_mpeg_demux_plugin_init      (GstPlugin *plugin);
+GType           gst_mpeg_demux_get_type          (void);
+
+gboolean        gst_mpeg_demux_plugin_init       (GstPlugin *plugin);
 
 G_END_DECLS
 

