diff -Naur gst-ffmpeg-0.10.5/ext/ffmpeg/gstffmpegmux.c gst-ffmpeg-0.10.5.new/ext/ffmpeg/gstffmpegmux.c
--- gst-ffmpeg-0.10.5/ext/ffmpeg/gstffmpegmux.c	2008-07-14 07:06:39.000000000 -0400
+++ gst-ffmpeg-0.10.5.new/ext/ffmpeg/gstffmpegmux.c	2008-10-02 23:19:38.366742928 -0400
@@ -294,6 +294,30 @@
   return pad;
 }
 
+
+static void
+gst_ffmpegmux_reset (GstFFMpegMux *ffmpegmux)
+{
+  GSList *collected;
+      
+  if (ffmpegmux->tags) {
+    gst_tag_list_free (ffmpegmux->tags);
+    ffmpegmux->tags = NULL;
+  }
+  if (ffmpegmux->opened) {
+    ffmpegmux->opened = FALSE;
+    url_fclose (ffmpegmux->context->pb);
+  }
+  
+  for (collected = ffmpegmux->collect->data; collected;
+       collected = g_slist_next (collected)) {
+    GstFFMpegMuxPad *collect_pad = (GstFFMpegMuxPad *) collected->data;
+    AVStream *st = ffmpegmux->context->streams[collect_pad->padnum];
+    av_reset_stream (st);
+  }
+}
+
+
 /**
  * gst_ffmpegmux_setcaps
  * @pad: #GstPad
@@ -617,14 +641,7 @@
     case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
       break;
     case GST_STATE_CHANGE_PAUSED_TO_READY:
-      if (ffmpegmux->tags) {
-        gst_tag_list_free (ffmpegmux->tags);
-        ffmpegmux->tags = NULL;
-      }
-      if (ffmpegmux->opened) {
-        ffmpegmux->opened = FALSE;
-        url_fclose (ffmpegmux->context->pb);
-      }
+      gst_ffmpegmux_reset (ffmpegmux);
       break;
     case GST_STATE_CHANGE_READY_TO_NULL:
       break;
diff -Naur gst-ffmpeg-0.10.5/gst-libs/ext/ffmpeg/libavformat/avformat.h gst-ffmpeg-0.10.5.new/gst-libs/ext/ffmpeg/libavformat/avformat.h
--- gst-ffmpeg-0.10.5/gst-libs/ext/ffmpeg/libavformat/avformat.h	2008-09-03 10:31:59.000000000 -0400
+++ gst-ffmpeg-0.10.5.new/gst-libs/ext/ffmpeg/libavformat/avformat.h	2008-10-02 23:19:55.993533942 -0400
@@ -815,6 +815,12 @@
 AVProgram *av_new_program(AVFormatContext *s, int id);
 
 /**
+ * Reset stream context
+ * @param s stream
+ */
+void av_reset_stream(AVStream *st);
+
+/**
  * Add a new chapter.
  * This function is NOT part of the public API
  * and should be ONLY used by demuxers.
diff -Naur gst-ffmpeg-0.10.5/gst-libs/ext/ffmpeg/libavformat/utils.c gst-ffmpeg-0.10.5.new/gst-libs/ext/ffmpeg/libavformat/utils.c
--- gst-ffmpeg-0.10.5/gst-libs/ext/ffmpeg/libavformat/utils.c	2008-09-03 10:31:59.000000000 -0400
+++ gst-ffmpeg-0.10.5.new/gst-libs/ext/ffmpeg/libavformat/utils.c	2008-10-02 23:20:12.888933772 -0400
@@ -2302,10 +2302,29 @@
         url_fclose(pb);
 }
 
+void av_reset_stream(AVStream *st)
+{
+    int i;
+    st->start_time = AV_NOPTS_VALUE;
+    st->duration = AV_NOPTS_VALUE;
+        /* we set the current DTS to 0 so that formats without any timestamps
+           but durations get some timestamps, formats with some unknown
+           timestamps have their first few packets buffered and the
+           timestamps corrected before they are returned to the user */
+    st->cur_dts = 0;
+    st->first_dts = AV_NOPTS_VALUE;
+
+    /* default pts setting is MPEG-like */
+    av_set_pts_info(st, 33, 1, 90000);
+    st->last_IP_pts = AV_NOPTS_VALUE;
+    for(i=0; i<MAX_REORDER_DELAY+1; i++)
+        st->pts_buffer[i]= AV_NOPTS_VALUE;
+}
+
+  
 AVStream *av_new_stream(AVFormatContext *s, int id)
 {
     AVStream *st;
-    int i;
 
     if (s->nb_streams >= MAX_STREAMS)
         return NULL;
@@ -2321,21 +2340,7 @@
     }
     st->index = s->nb_streams;
     st->id = id;
-    st->start_time = AV_NOPTS_VALUE;
-    st->duration = AV_NOPTS_VALUE;
-        /* we set the current DTS to 0 so that formats without any timestamps
-           but durations get some timestamps, formats with some unknown
-           timestamps have their first few packets buffered and the
-           timestamps corrected before they are returned to the user */
-    st->cur_dts = 0;
-    st->first_dts = AV_NOPTS_VALUE;
-
-    /* default pts setting is MPEG-like */
-    av_set_pts_info(st, 33, 1, 90000);
-    st->last_IP_pts = AV_NOPTS_VALUE;
-    for(i=0; i<MAX_REORDER_DELAY+1; i++)
-        st->pts_buffer[i]= AV_NOPTS_VALUE;
-
+    av_reset_stream(st);
     st->sample_aspect_ratio = (AVRational){0,1};
 
     s->streams[s->nb_streams++] = st;
