From e55bf9bdd82299b8498b267b67997872df7e18fa Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Thu, 22 Oct 2009 09:12:03 -0300 Subject: [PATCH] audiorate: move debug calculation into debug macro Remove in_duration and move its calculation to GST_LOG_OBJECT macro. This way it will only be calculated if we have debug enabled. --- gst/audiorate/gstaudiorate.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gst/audiorate/gstaudiorate.c b/gst/audiorate/gstaudiorate.c index cf28dad..c87c234 100644 --- a/gst/audiorate/gstaudiorate.c +++ b/gst/audiorate/gstaudiorate.c @@ -475,7 +475,7 @@ static GstFlowReturn gst_audio_rate_chain (GstPad * pad, GstBuffer * buf) { GstAudioRate *audiorate; - GstClockTime in_time, in_duration, run_time; + GstClockTime in_time, run_time; guint64 in_offset, in_offset_end, in_samples; guint in_size; GstFlowReturn ret = GST_FLOW_OK; @@ -519,9 +519,6 @@ gst_audio_rate_chain (GstPad * pad, GstBuffer * buf) in_size = GST_BUFFER_SIZE (buf); in_samples = in_size / audiorate->bytes_per_sample; - /* get duration from the size because we can and it's more accurate */ - in_duration = - gst_util_uint64_scale_int_round (in_samples, GST_SECOND, audiorate->rate); /* Figure out the total accumulated segment time. */ run_time = in_time + audiorate->src_segment.accum; @@ -537,8 +534,8 @@ gst_audio_rate_chain (GstPad * pad, GstBuffer * buf) ", in_size:%u, in_offset:%" G_GUINT64_FORMAT ", in_offset_end:%" G_GUINT64_FORMAT ", ->next_offset:%" G_GUINT64_FORMAT, GST_TIME_ARGS (in_time), GST_TIME_ARGS (run_time), - GST_TIME_ARGS (in_duration), in_size, in_offset, in_offset_end, - audiorate->next_offset); + GST_TIME_ARGS (GST_FRAMES_TO_CLOCK_TIME (in_samples, audiorate->rate)), + in_size, in_offset, in_offset_end, audiorate->next_offset); /* do we need to insert samples */ if (in_offset > audiorate->next_offset) { -- 2.7.4