ext/mad/gstmad.c: Fix seeking even more by sending the newsegment event with the...
authorTim-Philipp Müller <tim@centricular.net>
Tue, 22 Nov 2005 18:39:36 +0000 (18:39 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Tue, 22 Nov 2005 18:39:36 +0000 (18:39 +0000)
Original commit message from CVS:
* ext/mad/gstmad.c: (gst_mad_chain):
Fix seeking even more by sending the newsegment event with the
right parameters. Should fix querying in playbin/totem after
a seek.

ChangeLog
ext/mad/gstmad.c

index d9692c3..274c528 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2005-11-22  Tim-Philipp Müller  <tim at centricular dot net>
 
+       * ext/mad/gstmad.c: (gst_mad_chain):
+         Fix seeking even more by sending the newsegment event with the
+         right parameters. Should fix querying in playbin/totem after
+         a seek.
+
+2005-11-22  Tim-Philipp Müller  <tim at centricular dot net>
+
        * ext/mad/gstmad.c: (gst_mad_mode_get_type), (gst_mad_src_query),
        (normal_seek), (gst_mad_sink_event), (gst_mad_chain):
          Fix seeking in stand-alone mode. Fix nonexistant enum value 
index e1a1cd0..e1d45cc 100644 (file)
@@ -1533,14 +1533,19 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer)
         }
 
         if (do_send_discont) {
+          gint64 start = GST_BUFFER_TIMESTAMP (outbuffer);
+
+          GST_DEBUG ("Sending NEWSEGMENT event, start=%" GST_TIME_FORMAT,
+              GST_TIME_ARGS (start));
+
           gst_pad_push_event (mad->srcpad,
               gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME,
-                  GST_BUFFER_TIMESTAMP (outbuffer), GST_CLOCK_TIME_NONE, 0));
+                  start, GST_CLOCK_TIME_NONE, start));
           do_send_discont = FALSE;
         }
 
         result = gst_pad_push (mad->srcpad, outbuffer);
-        if (result != GST_FLOW_OK) {
+        if (result != GST_FLOW_OK && result != GST_FLOW_NOT_LINKED) {
           goto end;
         }
       }