Activate pads before adding.
authorWim Taymans <wim.taymans@gmail.com>
Fri, 6 Oct 2006 17:00:14 +0000 (17:00 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 6 Oct 2006 17:00:14 +0000 (17:00 +0000)
Original commit message from CVS:
* ext/dv/gstdvdemux.c: (gst_dvdemux_add_pads), (gst_dvdemux_chain):
* gst/auparse/gstauparse.c: (gst_au_parse_add_srcpad):
Activate pads before adding.

ChangeLog
ext/dv/gstdvdemux.c
gst/auparse/gstauparse.c

index f7de3cb..778bd6d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-10-06  Wim Taymans  <wim@fluendo.com>
 
+       * ext/dv/gstdvdemux.c: (gst_dvdemux_add_pads), (gst_dvdemux_chain):
+       * gst/auparse/gstauparse.c: (gst_au_parse_add_srcpad):
+       Activate pads before adding.
+
+2006-10-06  Wim Taymans  <wim@fluendo.com>
+
        * gst/multipart/multipartdemux.c: (gst_multipart_demux_init),
        (gst_multipart_find_pad_by_mime):
        Activate pads before adding.
index 7d25c24..fb47bb3 100644 (file)
@@ -306,6 +306,7 @@ gst_dvdemux_add_pads (GstDVDemux * dvdemux)
   gst_pad_set_event_function (dvdemux->videosrcpad,
       GST_DEBUG_FUNCPTR (gst_dvdemux_handle_src_event));
   gst_pad_use_fixed_caps (dvdemux->videosrcpad);
+  gst_pad_set_active (dvdemux->videosrcpad, TRUE);
   gst_element_add_pad (GST_ELEMENT (dvdemux), dvdemux->videosrcpad);
 
   dvdemux->audiosrcpad =
@@ -317,6 +318,7 @@ gst_dvdemux_add_pads (GstDVDemux * dvdemux)
   gst_pad_set_event_function (dvdemux->audiosrcpad,
       GST_DEBUG_FUNCPTR (gst_dvdemux_handle_src_event));
   gst_pad_use_fixed_caps (dvdemux->audiosrcpad);
+  gst_pad_set_active (dvdemux->audiosrcpad, TRUE);
   gst_element_add_pad (GST_ELEMENT (dvdemux), dvdemux->audiosrcpad);
 
   gst_element_no_more_pads (GST_ELEMENT (dvdemux));
@@ -1491,6 +1493,7 @@ gst_dvdemux_chain (GstPad * pad, GstBuffer * buffer)
 {
   GstDVDemux *dvdemux;
   GstFlowReturn ret;
+  GstClockTime timestamp;
 
   dvdemux = GST_DVDEMUX (gst_pad_get_parent (pad));
 
@@ -1500,6 +1503,14 @@ gst_dvdemux_chain (GstPad * pad, GstBuffer * buffer)
   if (G_UNLIKELY (GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT)))
     gst_adapter_clear (dvdemux->adapter);
 
+  /* a timestamp always should be respected */
+  timestamp = GST_BUFFER_TIMESTAMP (buffer);
+  if (GST_CLOCK_TIME_IS_VALID (timestamp)) {
+    gst_segment_set_last_stop (&dvdemux->time_segment, GST_FORMAT_TIME,
+        timestamp);
+    /* FIXME, adjust frame_offset and other counters */
+  }
+
   /* temporary hack? Can't do this from the state change */
   if (G_UNLIKELY (!dvdemux->videosrcpad))
     gst_dvdemux_add_pads (dvdemux);
index 406e545..4664984 100644 (file)
@@ -197,6 +197,7 @@ gst_au_parse_add_srcpad (GstAuParse * auparse, GstCaps * new_caps)
         GST_DEBUG_FUNCPTR (gst_au_parse_src_event));
 
     gst_pad_use_fixed_caps (auparse->srcpad);
+    gst_pad_set_active (auparse->srcpad, TRUE);
 
     if (auparse->src_caps)
       gst_pad_set_caps (auparse->srcpad, auparse->src_caps);