summaryrefslogtreecommitdiffstats
path: root/ext/dv
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2006-10-06 17:00:14 +0000
committerWim Taymans <wim.taymans@gmail.com>2006-10-06 17:00:14 +0000
commit3adedd4f6061ae5029b880a384346d1cbc856a47 (patch)
treefb1d61311497384cb6085827d79e2c01e5f184d3 /ext/dv
parent09328ad0104734def11242b6c9d750845e92c5de (diff)
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.
Diffstat (limited to 'ext/dv')
-rw-r--r--ext/dv/gstdvdemux.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/dv/gstdvdemux.c b/ext/dv/gstdvdemux.c
index 7d25c249..fb47bb31 100644
--- a/ext/dv/gstdvdemux.c
+++ b/ext/dv/gstdvdemux.c
@@ -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);