From 9ee4ef806134e14a5fa9ebe7438e0aca553bad07 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Tue, 19 Feb 2002 12:55:16 +0000 Subject: [PATCH] somebody help me fix lame ;) Original commit message from CVS: somebody help me fix lame ;) I commented out the state change function because it is called before lame has the right caps. Is the state change function still necessary ? in any case, at least now lame actually listens to osssrc re: rate and channels --- ext/lame/gstlame.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/lame/gstlame.c b/ext/lame/gstlame.c index a5c7479..2cd83ca 100644 --- a/ext/lame/gstlame.c +++ b/ext/lame/gstlame.c @@ -320,7 +320,7 @@ gst_lame_class_init (GstLameClass *klass) gobject_class->set_property = gst_lame_set_property; gobject_class->get_property = gst_lame_get_property; - gstelement_class->change_state = gst_lame_change_state; + //gstelement_class->change_state = gst_lame_change_state; } static GstPadConnectReturn @@ -340,8 +340,9 @@ gst_lame_sinkconnect (GstPad *pad, GstCaps *caps) gst_event_new_info ("channels", GST_PROPS_INT (lame->num_channels), NULL)); gst_element_send_event (GST_ELEMENT (lame), gst_event_new_info ("rate", GST_PROPS_INT (lame->samplerate), NULL)); - + GST_DEBUG (0, "rate=%d, channels=%d\n", lame->samplerate, lame->num_channels); + g_print ("rate=%d, channels=%d\n", lame->samplerate, lame->num_channels); if (gst_lame_setup (lame)) { lame->initialized = TRUE; @@ -710,8 +711,11 @@ gst_lame_setup (GstLame *lame) { GST_DEBUG_ENTER ("(\"%s\")", gst_element_get_name (GST_ELEMENT (lame))); + g_assert (!lame->initialized); + /* copy the parameters over */ lame_set_in_samplerate (lame->lgf, lame->samplerate); + /* force mono encoding if we only have one channel */ if (lame->num_channels == 1) lame->mode = 3; -- 2.7.4