From: David Schleef Date: Mon, 14 Jul 2003 08:30:45 +0000 (+0000) Subject: Simple replacement for faster, but broken, algorithm. Needs to be refixed. X-Git-Tag: 1.19.3~511^2~15345 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=874eab7a0a830adc8a3609853af432e70066934a;p=platform%2Fupstream%2Fgstreamer.git Simple replacement for faster, but broken, algorithm. Needs to be refixed. Original commit message from CVS: Simple replacement for faster, but broken, algorithm. Needs to be refixed. --- diff --git a/gst/sine/gstsinesrc.c b/gst/sine/gstsinesrc.c index 2eee3693e7..a6eb692103 100644 --- a/gst/sine/gstsinesrc.c +++ b/gst/sine/gstsinesrc.c @@ -237,7 +237,7 @@ gst_sinesrc_get (GstPad *pad) src->timestamp += (gint64)src->samples_per_buffer * GST_SECOND / (gint64)src->samplerate; while(GST_DPMAN_PROCESS(src->dpman, i)) { - +#if 0 src->table_lookup = (gint)(src->table_pos); src->table_lookup_next = src->table_lookup + 1; src->table_interp = src->table_pos - src->table_lookup; @@ -264,6 +264,13 @@ gst_sinesrc_get (GstPad *pad) ) )+src->table_data[src->table_lookup] )* src->volume * 32767.0; +#endif + src->accumulator += 2*M_PI*src->freq / src->samplerate; + if(src->accumulator >= 2*M_PI){ + src->accumulator -= 2*M_PI; + } + samples[i] = sin(src->accumulator) * src->volume * 32767.0; + i++; }