Index: gst/playback/gstdecodebin.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst/playback/gstdecodebin.c,v
retrieving revision 1.93
diff -u -B -b -p -r1.93 gstdecodebin.c
--- gst/playback/gstdecodebin.c	4 Mar 2007 23:39:50 -0000	1.93
+++ gst/playback/gstdecodebin.c	9 Mar 2007 15:31:30 -0000
@@ -623,8 +623,10 @@ remove_fakesink (GstDecodeBin * decode_b
   if (removed_fakesink) {
     free_pad_probes (decode_bin);
 
+#if 0
     gst_element_post_message (GST_ELEMENT_CAST (decode_bin),
         gst_message_new_state_dirty (GST_OBJECT_CAST (decode_bin)));
+#endif
   }
 }
 
Index: gst/playback/gstplaybin.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst/playback/gstplaybin.c,v
retrieving revision 1.107
diff -u -B -b -p -r1.107 gstplaybin.c
--- gst/playback/gstplaybin.c	4 Mar 2007 23:39:51 -0000	1.107
+++ gst/playback/gstplaybin.c	9 Mar 2007 15:31:30 -0000
@@ -1137,8 +1137,8 @@ link_failed:
  * visualisation ouput.  The idea is to split the audio using tee, then 
  * sending the output to the regular audio bin and the other output to
  * the vis plugin that transforms it into a video that is rendered with the
- * normal video bin. The video bin is run in a thread to make sure it does
- * not block the audio playback pipeline.
+ * normal video bin. The video and audio bins are run in threads to make sure
+ * they don't block eachother.
  *
  *  +-----------------------------------------------------------------------+
  *  | visbin                                                                |
@@ -1154,7 +1154,7 @@ link_failed:
  *  |   |  |      |                                                         |
  *  |   |  +------+                                                         |
  * sink-+                                                                   |
-   +------------------------------------------------------------------------+
+ *  +-----------------------------------------------------------------------+
  */
 static GstElement *
 gen_vis_element (GstPlayBin * play_bin)
@@ -1407,11 +1407,6 @@ add_sink (GstPlayBin * play_bin, GstElem
 
   g_return_val_if_fail (sink != NULL, FALSE);
 
-  /* For live pipelines we need to add the bin in the same state as the 
-   * parent so that it starts as soon as it is prerolled. */
-  if (play_bin->is_live)
-    state = GST_STATE_PLAYING;
-  else
     state = GST_STATE_PAUSED;
 
   /* this is only for debugging */
@@ -1425,10 +1420,12 @@ add_sink (GstPlayBin * play_bin, GstElem
 
   /* for live pipelines, disable the sync in the sinks until core handles this
    * correctly. */
-  if (play_bin->is_live)
+  if (play_bin->is_live) {
+    gst_pipeline_use_clock (GST_PIPELINE (play_bin), NULL);
     gst_element_set_clock (sink, NULL);
+  }
 
-  /* bring it to the PAUSED state so we can link to the peer without
+  /* bring it to the required state so we can link to the peer without
    * breaking the flow */
   stateret = gst_element_set_state (sink, state);
   if (stateret == GST_STATE_CHANGE_FAILURE)
@@ -1677,48 +1674,6 @@ gst_play_bin_send_event_to_sink (GstPlay
   return res;
 }
 
-static gboolean
-do_playbin_seek (GstElement * element, GstEvent * event)
-{
-  gdouble rate;
-  GstSeekFlags flags;
-  gboolean flush;
-  gboolean was_playing = FALSE;
-  gboolean res;
-
-  gst_event_parse_seek (event, &rate, NULL, &flags, NULL, NULL, NULL, NULL);
-
-  flush = flags & GST_SEEK_FLAG_FLUSH;
-
-  if (flush) {
-    GstState state;
-
-    /* need to call _get_state() since a bin state is only updated
-     * with this call. */
-    gst_element_get_state (element, &state, NULL, 0);
-    was_playing = state == GST_STATE_PLAYING;
-
-    if (was_playing) {
-      gst_element_set_state (element, GST_STATE_PAUSED);
-      gst_element_get_state (element, NULL, NULL, 50 * GST_MSECOND);
-    }
-  }
-
-  GST_DEBUG_OBJECT (element, "Sending seek event to a sink");
-  res = gst_play_bin_send_event_to_sink (GST_PLAY_BIN (element), event);
-
-  if (flush) {
-    /* need to reset the stream time to 0 after a flushing seek */
-    if (res)
-      gst_pipeline_set_new_stream_time (GST_PIPELINE (element), 0);
-
-    if (was_playing)
-      /* and continue playing */
-      gst_element_set_state (element, GST_STATE_PLAYING);
-  }
-  return res;
-}
-
 /* We only want to send the event to a single sink (overriding GstBin's 
  * behaviour), but we want to keep GstPipeline's behaviour - wrapping seek
  * events appropriately. So, this is a messy duplication of code. */
@@ -1728,13 +1683,13 @@ gst_play_bin_send_event (GstElement * el
   gboolean res = FALSE;
   GstEventType event_type = GST_EVENT_TYPE (event);
 
-
   switch (event_type) {
     case GST_EVENT_SEEK:
-      res = do_playbin_seek (element, event);
+      GST_DEBUG_OBJECT (element, "Sending seek event to a sink");
+      res = gst_play_bin_send_event_to_sink (GST_PLAY_BIN (element), event);
       break;
     default:
-      res = gst_play_bin_send_event_to_sink (GST_PLAY_BIN (element), event);
+      res = parent_class->send_event (element, event);
       break;
   }
 
@@ -1886,6 +1841,7 @@ gst_play_bin_change_state (GstElement * 
 
   switch (transition) {
     case GST_STATE_CHANGE_READY_TO_PAUSED:
+      gst_pipeline_auto_clock (GST_PIPELINE (play_bin));
       /* this really is the easiest way to make the state change return
        * ASYNC until we added the sinks */
       if (!play_bin->fakesink) {
Index: gst-libs/gst/audio/gstbaseaudiosrc.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/audio/gstbaseaudiosrc.c,v
retrieving revision 1.30
diff -u -B -b -p -r1.30 gstbaseaudiosrc.c
--- gst-libs/gst/audio/gstbaseaudiosrc.c	28 Feb 2007 15:02:25 -0000	1.30
+++ gst-libs/gst/audio/gstbaseaudiosrc.c	9 Mar 2007 15:31:30 -0000
@@ -522,12 +522,21 @@ gst_base_audio_src_create (GstBaseSrc * 
   gint bps;
   GstRingBuffer *ringbuffer;
   guint read;
+  GstClockTime timestamp, base_time;
+  guint64 base_sample;
 
   ringbuffer = src->ringbuffer;
 
   if (G_UNLIKELY (!gst_ring_buffer_is_acquired (ringbuffer)))
     goto wrong_state;
 
+  /* figure out what sample to get, FIXME, we should look at the base_time and
+   * the clock time (our pointer in the ringbuffer), then figure out the sample
+   * for that time and return it. */
+  base_time = gst_element_get_base_time (GST_ELEMENT_CAST (src));
+
+  base_sample = gst_util_uint64_scale_int (base_time, ringbuffer->spec.rate, GST_SECOND);
+
   bps = ringbuffer->spec.bytes_per_sample;
 
   if ((length == 0 && bsrc->blocksize == 0) || length == -1)
@@ -550,6 +559,14 @@ gst_base_audio_src_create (GstBaseSrc * 
     sample = gst_base_audio_src_get_offset (src);
   }
 
+  GST_DEBUG_OBJECT (src, "reading from sample %"G_GUINT64_FORMAT, sample);
+
+#if 0
+  sample += base_sample;
+#endif
+
+  GST_DEBUG_OBJECT (src, "after adding base_time: %"G_GUINT64_FORMAT, sample);
+
   /* get the number of samples to read */
   samples = length / bps;
 
@@ -588,8 +605,15 @@ gst_base_audio_src_create (GstBaseSrc * 
    * where we are slaved to another clock. We currently refuse to accept
    * any other clock than the one we provide, so this code is fine for
    * now. */
-  GST_BUFFER_TIMESTAMP (buf) = gst_util_uint64_scale_int (sample,
-      GST_SECOND, ringbuffer->spec.rate);
+#if 0
+  sample += base_sample;
+#endif
+  timestamp = gst_util_uint64_scale_int (sample, GST_SECOND, ringbuffer->spec.rate);
+#if 0
+  sample -= base_sample;
+#endif
+
+  GST_BUFFER_TIMESTAMP (buf) = timestamp;
   src->next_sample = sample + samples;
   GST_BUFFER_DURATION (buf) = gst_util_uint64_scale_int (src->next_sample,
       GST_SECOND, ringbuffer->spec.rate) - GST_BUFFER_TIMESTAMP (buf);
@@ -670,6 +694,7 @@ gst_base_audio_src_change_state (GstElem
       break;
     case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
       gst_ring_buffer_may_start (src->ringbuffer, TRUE);
+      gst_ring_buffer_start (src->ringbuffer);
       break;
     case GST_STATE_CHANGE_PAUSED_TO_READY:
       gst_ring_buffer_set_flushing (src->ringbuffer, TRUE);
Index: sys/v4l/v4lsrc_calls.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/sys/v4l/v4lsrc_calls.c,v
retrieving revision 1.56
diff -u -B -b -p -r1.56 v4lsrc_calls.c
--- sys/v4l/v4lsrc_calls.c	28 Feb 2007 15:05:03 -0000	1.56
+++ sys/v4l/v4lsrc_calls.c	9 Mar 2007 15:31:31 -0000
@@ -721,7 +721,7 @@ gst_v4lsrc_buffer_new (GstV4lSrc * v4lsr
   if (timestamp > latency)
     timestamp -= latency;
   else
-    timestamp = 0;
+    timestamp = GST_CLOCK_TIME_NONE;
 
   GST_BUFFER_TIMESTAMP (buf) = timestamp;
   GST_BUFFER_DURATION (buf) = duration;
