+2007-03-07 Stefan Kost <ensonic@users.sf.net>
+
+ * gst/spectrum/gstspectrum.c: (gst_spectrum_start),
+ (gst_spectrum_event), (gst_spectrum_transform_ip):
+ * gst/spectrum/gstspectrum.h:
+ One FIXME less, by resolving message timestamps against the playback
+ segment.
+
2007-03-06 Wim Taymans <wim@fluendo.com>
* gst/spectrum/gstspectrum.c: (gst_spectrum_class_init),
GstSpectrum *filter = GST_SPECTRUM (trans);
filter->num_frames = 0;
+ gst_segment_init (&filter->segment, GST_FORMAT_UNDEFINED);
return TRUE;
}
case GST_EVENT_EOS:
gst_adapter_clear (filter->adapter);
break;
+ case GST_EVENT_NEWSEGMENT:{
+ GstFormat format;
+ gdouble rate, arate;
+ gint64 start, stop, time;
+ gboolean update;
+
+ /* the newsegment values are used to clip the input samples
+ * and to convert the incomming timestamps to running time */
+ gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
+ &start, &stop, &time);
+
+ /* now configure the values */
+ gst_segment_set_newsegment_full (&filter->segment, update,
+ rate, arate, format, start, stop, time);
+ break;
+ }
default:
break;
}
gfloat pos, step;
guchar *spect = spectrum->spect;
- /* FIXME, the buffer timestamp does not mean anything, maybe you mean
- * stream_time or running_time? */
- GstClockTime endtime = GST_BUFFER_TIMESTAMP (in);
+ GstClockTime endtime =
+ gst_segment_to_running_time (&spectrum->segment, GST_FORMAT_TIME,
+ GST_BUFFER_TIMESTAMP (in));
GstClockTime blktime =
GST_FRAMES_TO_CLOCK_TIME (spectrum->len, spectrum->rate);