mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
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.
This commit is contained in:
parent
383483f966
commit
874eab7a0a
1 changed files with 8 additions and 1 deletions
|
@ -237,7 +237,7 @@ gst_sinesrc_get (GstPad *pad)
|
||||||
src->timestamp += (gint64)src->samples_per_buffer * GST_SECOND / (gint64)src->samplerate;
|
src->timestamp += (gint64)src->samples_per_buffer * GST_SECOND / (gint64)src->samplerate;
|
||||||
|
|
||||||
while(GST_DPMAN_PROCESS(src->dpman, i)) {
|
while(GST_DPMAN_PROCESS(src->dpman, i)) {
|
||||||
|
#if 0
|
||||||
src->table_lookup = (gint)(src->table_pos);
|
src->table_lookup = (gint)(src->table_pos);
|
||||||
src->table_lookup_next = src->table_lookup + 1;
|
src->table_lookup_next = src->table_lookup + 1;
|
||||||
src->table_interp = src->table_pos - src->table_lookup;
|
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->table_data[src->table_lookup]
|
||||||
)* src->volume * 32767.0;
|
)* 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++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue