From: Wim T. <wt...@us...> - 2002-07-07 14:06:54
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: wtay Date: Sun Jul 07 2002 07:06:50 PDT Log message: Lame should accept events even when not negotiated yet. Modified files: ext/lame : gstlame.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/lame/gstlame.c.diff?r1=1.16&r2=1.17 ====Begin Diffs==== Index: gstlame.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/ext/lame/gstlame.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- gstlame.c 8 Jun 2002 09:26:09 -0000 1.16 +++ gstlame.c 7 Jul 2002 14:06:38 -0000 1.17 @@ -683,17 +683,6 @@ GST_DEBUG (GST_CAT_PLUGIN_INFO, "entered chain"); - if (!lame->initialized) { - gst_element_error (GST_ELEMENT (lame), "encoder not initialized (input is not audio?)"); - if (GST_IS_EVENT (buf)) { - gst_pad_event_default (pad, GST_EVENT (buf)); - } - else { - gst_buffer_unref (buf); - } - return; - } - if (GST_IS_EVENT (buf)) { switch (GST_EVENT_TYPE (buf)) { case GST_EVENT_EOS: @@ -711,6 +700,12 @@ } } else { + if (!lame->initialized) { + gst_buffer_unref (buf); + gst_element_error (GST_ELEMENT (lame), "encoder not initialized (input is not audio?)"); + return; + } + /* allocate space for output */ mp3_buffer_size = ((GST_BUFFER_SIZE(buf) / (2+lame->num_channels)) * 1.25) + 7200; mp3_data = g_malloc (mp3_buffer_size); |