+2006-06-14 Wim Taymans <wim@fluendo.com>
+
+ * ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
+ (gst_dvdec_finalize), (gst_dvdec_sink_event),
+ (gst_dvdec_change_state):
+ Reset segment info on flush.
+ Alloc segment in _init, free in _finalize.
+
+ * ext/dv/gstdvdemux.c: (gst_dvdemux_handle_pull_seek):
+ Don't send segments twice.
+
2006-06-14 Wim Taymans <wim@fluendo.com>
* ext/dv/gstdvdemux.c: (gst_dvdemux_demux_frame):
GST_BOILERPLATE (GstDVDec, gst_dvdec, GstElement, GST_TYPE_ELEMENT);
+static void gst_dvdec_finalize (GObject * object);
static gboolean gst_dvdec_sink_setcaps (GstPad * pad, GstCaps * caps);
static GstFlowReturn gst_dvdec_chain (GstPad * pad, GstBuffer * buffer);
static gboolean gst_dvdec_sink_event (GstPad * pad, GstEvent * event);
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->finalize = gst_dvdec_finalize;
gobject_class->set_property = gst_dvdec_set_property;
gobject_class->get_property = gst_dvdec_get_property;
dvdec->clamp_luma = FALSE;
dvdec->clamp_chroma = FALSE;
dvdec->quality = DV_DEFAULT_QUALITY;
+ dvdec->segment = gst_segment_new ();
+}
+
+static void
+gst_dvdec_finalize (GObject * object)
+{
+ GstDVDec *dvdec = GST_DVDEC (object);
+
+ gst_segment_free (dvdec->segment);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gboolean
dvdec = GST_DVDEC (gst_pad_get_parent (pad));
switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_FLUSH_STOP:
+ gst_segment_init (dvdec->segment, GST_FORMAT_UNDEFINED);
+ break;
case GST_EVENT_NEWSEGMENT:{
gboolean update;
gdouble rate;
/* Once -good depends on core >= 0.10.6, use newsegment_full */
gst_event_parse_new_segment (event, &update, &rate, &format,
&start, &stop, &position);
+
GST_DEBUG_OBJECT (dvdec, "Got NEWSEGMENT [%" GST_TIME_FORMAT
" - %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT "]",
GST_TIME_ARGS (start), GST_TIME_ARGS (stop),
GST_TIME_ARGS (position));
+
gst_segment_set_newsegment (dvdec->segment, update, rate, format,
start, stop, position);
- }
break;
+ }
default:
break;
}
dv_decoder_new (0, dvdec->clamp_luma, dvdec->clamp_chroma);
dvdec->decoder->quality = qualities[dvdec->quality];
dv_set_error_log (dvdec->decoder, NULL);
- dvdec->segment = gst_segment_new ();
gst_segment_init (dvdec->segment, GST_FORMAT_UNDEFINED);
/*
* Enable this function call when libdv2 0.100 or higher is more
case GST_STATE_CHANGE_PAUSED_TO_READY:
dv_decoder_free (dvdec->decoder);
dvdec->decoder = NULL;
- gst_segment_free (dvdec->segment);
- dvdec->segment = NULL;
break;
case GST_STATE_CHANGE_READY_TO_NULL:
break;