From: Benjamin Otte Date: Fri, 7 May 2004 00:43:50 +0000 (+0000) Subject: ext/lame/gstlame.c: simplify X-Git-Tag: 1.16.2~901^2~134 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a44705e0b50deb512855573e1444a6a897295f4;p=platform%2Fupstream%2Fgst-plugins-good.git ext/lame/gstlame.c: simplify Original commit message from CVS: * ext/lame/gstlame.c: (gst_lame_chain): simplify * ext/mad/gstmad.c: (gst_mad_handle_event): fix event leak * gst/typefind/gsttypefindfunctions.c: (mp3_type_find): be able to detect mp3 files < 4096 bytes --- diff --git a/ext/lame/gstlame.c b/ext/lame/gstlame.c index c3e30b7..b145f7e 100644 --- a/ext/lame/gstlame.c +++ b/ext/lame/gstlame.c @@ -797,16 +797,10 @@ gst_lame_chain (GstPad * pad, GstData * _data) ((GST_BUFFER_SIZE (buf) / (2 + lame->num_channels)) * 1.25) + 7200; mp3_data = g_malloc (mp3_buffer_size); - if (lame->num_channels == 2) { - mp3_size = lame_encode_buffer_interleaved (lame->lgf, - (short int *) (GST_BUFFER_DATA (buf)), - GST_BUFFER_SIZE (buf) / 4, mp3_data, mp3_buffer_size); - } else { - mp3_size = lame_encode_buffer (lame->lgf, - (short int *) (GST_BUFFER_DATA (buf)), - (short int *) (GST_BUFFER_DATA (buf)), - GST_BUFFER_SIZE (buf) / 2, mp3_data, mp3_buffer_size); - } + mp3_size = lame_encode_buffer_interleaved (lame->lgf, + (short int *) (GST_BUFFER_DATA (buf)), + GST_BUFFER_SIZE (buf) / 2 / lame->num_channels, + mp3_data, mp3_buffer_size); GST_DEBUG ("encoded %d bytes of audio to %d bytes of mp3", GST_BUFFER_SIZE (buf), mp3_size);