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
This commit is contained in:
Benjamin Otte 2004-05-07 00:43:50 +00:00
parent b24b7cf301
commit 1a44705e0b

View file

@ -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);
}
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);