Commit 3adedd4f authored by Wim Taymans's avatar Wim Taymans
Browse files

Activate pads before adding.

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.
parent 09328ad0
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),
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment