From: Wim Taymans Date: Sun, 7 Jul 2002 14:06:38 +0000 (+0000) Subject: Lame should accept events even when not negotiated yet. X-Git-Tag: 1.19.3~509^2~1916^2~179 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf5b28df374c5ecdacec431947ec6453dde86aac;p=platform%2Fupstream%2Fgstreamer.git Lame should accept events even when not negotiated yet. Original commit message from CVS: Lame should accept events even when not negotiated yet. --- diff --git a/ext/lame/gstlame.c b/ext/lame/gstlame.c index acbd1a5..58c2b9d 100644 --- a/ext/lame/gstlame.c +++ b/ext/lame/gstlame.c @@ -683,17 +683,6 @@ gst_lame_chain (GstPad *pad, GstBuffer *buf) 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 @@ gst_lame_chain (GstPad *pad, GstBuffer *buf) } } 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);