From 90736bc6e7118d1814bd3daa27b5db949b52f88a Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Fri, 16 Dec 2005 22:00:07 +0000 Subject: [PATCH] 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 --- ChangeLog | 10 ++++++++++ common | 2 +- ext/libvisual/visual.c | 2 +- gst/audiotestsrc/gstaudiotestsrc.c | 22 ++++++++++++++++++++++ gst/audiotestsrc/gstaudiotestsrc.h | 5 +++++ 5 files changed, 39 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 868933d..a86438a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-12-16 Stefan Kost + + * 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 + 2005-12-16 Tim-Philipp Müller * tests/check/generic/states.c: (GST_START_TEST): diff --git a/common b/common index 4edc214..d1911d4 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 4edc214072fe07d2aade96bc336493425654d7b4 +Subproject commit d1911d4b3d6267f9cd9dfb68fcef2afe4d098092 diff --git a/ext/libvisual/visual.c b/ext/libvisual/visual.c index b7e6360..b691e52 100644 --- a/ext/libvisual/visual.c +++ b/ext/libvisual/visual.c @@ -507,7 +507,7 @@ make_valid_name (char *name) /* * Replace invalid chars with _ in the type name */ - static const gchar *extra_chars = "-_+"; + static const gchar extra_chars[] = "-_+"; gchar *p = name; for (; *p; p++) { diff --git a/gst/audiotestsrc/gstaudiotestsrc.c b/gst/audiotestsrc/gstaudiotestsrc.c index 3be8308..6aa66a2 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 ff326cd..5a8cd60 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; -- 2.7.4