From b1e7498707c7741cce212942731be5e8c2b48a51 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sat, 3 May 2008 21:34:18 +0200 Subject: [PATCH] src/gstaubiotempo.c: use kl by default, use GstClockTime also remove hop_size - 1, indent --- src/gstaubiotempo.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gstaubiotempo.c b/src/gstaubiotempo.c index dcfe854..cf325f5 100644 --- a/src/gstaubiotempo.c +++ b/src/gstaubiotempo.c @@ -126,7 +126,7 @@ gst_aubio_tempo_init (GstAubioTempo * filter, filter->silent = TRUE; - filter->type_onset = aubio_onset_hfc; + filter->type_onset = aubio_onset_kl; filter->buf_size = 1024; filter->hop_size = 512; @@ -192,7 +192,7 @@ static GstFlowReturn gst_aubio_tempo_transform_ip (GstBaseTransform * trans, GstBuffer * buf) { uint j; - GstAubioTempo *filter = GST_AUBIOTEMPO (trans); + GstAubioTempo *filter = GST_AUBIOTEMPO(trans); GstAudioFilter *audiofilter = GST_AUDIO_FILTER(trans); gint nsamples = GST_BUFFER_SIZE (buf) / (4 * audiofilter->format.channels); @@ -207,9 +207,10 @@ gst_aubio_tempo_transform_ip (GstBaseTransform * trans, GstBuffer * buf) aubio_tempo(filter->t, filter->ibuf, filter->out); if (filter->out->data[0][0]==1) { - gint64 now = GST_BUFFER_TIMESTAMP (buf); + GstClockTime now = GST_BUFFER_TIMESTAMP (buf); // correction of inside buffer time now += GST_FRAMES_TO_CLOCK_TIME(j, audiofilter->format.rate); + now -= GST_FRAMES_TO_CLOCK_TIME(filter->hop_size - 1, audiofilter->format.rate); if (filter->silent == FALSE) { g_print ("beat: %" GST_TIME_FORMAT "\n", GST_TIME_ARGS(now)); } -- 2.11.0