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 d9692c3fcc22a5464280fccb73f0fae1df7492a3..274c528a02e7d94f3c2968e7befc49dc2316c66a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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),
index e1a1cd0b4b9a84980968f8a2e450bc8dce606a47..e1d45cc4b1a17dd4c3d9f2a41b3cce6567ba306e 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;
         }
       }