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.
This commit is contained in:
Thiago Santos 2009-10-22 09:12:03 -03:00
parent d95b607e23
commit e55bf9bdd8

View file

@ -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) {