From 9847c13491862d7fd63c6340c19482c5ba71bc86 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 30 Dec 2006 20:01:35 +0000 Subject: [PATCH] ext/lame/gstlame.c: warn when outgoing sample rate is different from incoming Original commit message from CVS: * ext/lame/gstlame.c: (gst_lame_sink_setcaps), (gst_lame_chain): warn when outgoing sample rate is different from incoming --- ChangeLog | 5 +++++ ext/lame/gstlame.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc41c0b..6b16ddf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-12-30 Thomas Vander Stichele + + * ext/lame/gstlame.c: (gst_lame_sink_setcaps), (gst_lame_chain): + warn when outgoing sample rate is different from incoming + 2006-12-29 Jan Schmidt * gst/mpegaudioparse/gstmpegaudioparse.c: (gst_mp3parse_chain): diff --git a/ext/lame/gstlame.c b/ext/lame/gstlame.c index 7e7d27f..92f8bef 100644 --- a/ext/lame/gstlame.c +++ b/ext/lame/gstlame.c @@ -513,6 +513,11 @@ gst_lame_sink_setcaps (GstPad * pad, GstCaps * caps) out_samplerate = lame_get_out_samplerate (lame->lgf); if (out_samplerate == 0) goto zero_output_rate; + if (out_samplerate != lame->samplerate) { + GST_WARNING_OBJECT (lame, + "output samplerate %d is different from incoming samplerate %d", + out_samplerate, lame->samplerate); + } othercaps = gst_caps_new_simple ("audio/mpeg", @@ -1019,7 +1024,7 @@ gst_lame_chain (GstPad * pad, GstBuffer * buf) } GST_LOG_OBJECT (lame, "encoded %d bytes of audio to %d bytes of mp3", - GST_BUFFER_SIZE (buf), mp3_size); + size, mp3_size); duration = gst_util_uint64_scale_int (size, GST_SECOND, 2 * lame->samplerate * lame->num_channels); @@ -1027,7 +1032,7 @@ gst_lame_chain (GstPad * pad, GstBuffer * buf) if (GST_BUFFER_DURATION (buf) != GST_CLOCK_TIME_NONE && GST_BUFFER_DURATION (buf) != duration) { GST_DEBUG_OBJECT (lame, "incoming buffer had incorrect duration %" - GST_TIME_FORMAT "outgoing buffer will have correct duration %" + GST_TIME_FORMAT ", outgoing buffer will have correct duration %" GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_DURATION (buf)), GST_TIME_ARGS (duration)); } -- 2.7.4