summaryrefslogtreecommitdiff
path: root/gst/audiotestsrc
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sourceforge.net>2005-12-16 22:00:07 +0000
committerStefan Kost <ensonic@users.sourceforge.net>2005-12-16 22:00:07 +0000
commit90736bc6e7118d1814bd3daa27b5db949b52f88a (patch)
tree0b2f3935f94f71d46548ad9aac749a2335babd96 /gst/audiotestsrc
parent93bbbddaf439a63a29f9b32f770ab1dca29ab528 (diff)
ext/libvisual/visual.c: change some char* into char[]
Original commit message from CVS: * ext/libvisual/visual.c: (make_valid_name): change some char* into char[] * gst/audiotestsrc/gstaudiotestsrc.c: (gst_audio_test_src_class_init), (gst_audio_test_src_do_seek), (gst_audio_test_src_create): * gst/audiotestsrc/gstaudiotestsrc.h: prepare to handle EOS and SEGMENT_DONE
Diffstat (limited to 'gst/audiotestsrc')
-rw-r--r--gst/audiotestsrc/gstaudiotestsrc.c22
-rw-r--r--gst/audiotestsrc/gstaudiotestsrc.h5
2 files changed, 27 insertions, 0 deletions
diff --git a/gst/audiotestsrc/gstaudiotestsrc.c b/gst/audiotestsrc/gstaudiotestsrc.c
index 3be830860..6aa66a21d 100644
--- a/gst/audiotestsrc/gstaudiotestsrc.c
+++ b/gst/audiotestsrc/gstaudiotestsrc.c
@@ -543,6 +543,18 @@ gst_audio_test_src_do_seek (GstBaseSrc * basesrc, GstSegment * segment)
g_assert (src->running_time <= time);
+ /*
+ if (GST_CLOCK_TIME_IS_VALID (segment->stop)) {
+ time = segment->stop;
+ src->n_samples_stop = time * src->samplerate / GST_SECOND;
+ src->check_seek_stop = true;
+ src->seek_flags = segment.flags;
+ }
+ else {
+ src->check_seek_stop = false;
+ }
+ */
+
return TRUE;
}
@@ -583,6 +595,16 @@ gst_audio_test_src_create (GstBaseSrc * basesrc, guint64 offset,
GST_BUFFER_TIMESTAMP (buf) = src->timestamp_offset + src->running_time;
/* offset is the number of samples */
GST_BUFFER_OFFSET (buf) = src->n_samples;
+ /*
+ if (src->check_seek_stop &&
+ (src->n_samples_stop > src->n_samples) &&
+ (src->n_samples_stop < src->n_samples + src->samples_per_buffer)) {
+ src->n_samples = src->n_samples_stop;
+ @todo: calculate only partial buffer!
+ @todo: send EOS or SEGMENT_DONE depending on segment.flags&GST_SEEK_FLAG_SEGMENT
+ }
+ else
+ */
src->n_samples += src->samples_per_buffer;
GST_BUFFER_OFFSET_END (buf) = src->n_samples;
next_time = src->n_samples * GST_SECOND / src->samplerate;
diff --git a/gst/audiotestsrc/gstaudiotestsrc.h b/gst/audiotestsrc/gstaudiotestsrc.h
index ff326cd26..5a8cd6067 100644
--- a/gst/audiotestsrc/gstaudiotestsrc.h
+++ b/gst/audiotestsrc/gstaudiotestsrc.h
@@ -90,6 +90,11 @@ struct _GstAudioTestSrc {
GstClockTimeDiff timestamp_offset; /* base offset */
GstClockTime running_time; /* total running time */
gint64 n_samples; /* total samples sent */
+ /*
+ gint64 n_samples_stop;
+ gboolean check_seek_stop;
+ GstSeekFlags seek_flags;
+ */
/* waveform specific context data */
GstPinkNoise pink;