From: Zaheer Abbas Merali Date: Thu, 12 Aug 2004 16:12:00 +0000 (+0000) Subject: ext/lame/gstlame.c: made source pad link function check if sinkpad is ok..fixes the... X-Git-Tag: 1.16.2~901^2~123 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3071745903932525b4b95a21c78f0aa97066bb42;p=platform%2Fupstream%2Fgst-plugins-good.git ext/lame/gstlame.c: made source pad link function check if sinkpad is ok..fixes the problem where core fixates the ou... Original commit message from CVS: 2004-08-12 Zaheer Abbas Merali * ext/lame/gstlame.c: (gst_lame_src_link): made source pad link function check if sinkpad is ok..fixes the problem where core fixates the output rate of lame stupidly --- diff --git a/ext/lame/gstlame.c b/ext/lame/gstlame.c index ca06874..29d260a 100644 --- a/ext/lame/gstlame.c +++ b/ext/lame/gstlame.c @@ -353,7 +353,7 @@ gst_lame_src_link (GstPad * pad, const GstCaps * caps) GstLame *lame; gint out_samplerate; GstStructure *structure; - GstCaps *othercaps, *channelcaps; + GstCaps *othercaps, *channelcaps, *ratecaps; GstPadLinkReturn result; lame = GST_LAME (gst_pad_get_parent (pad)); @@ -363,6 +363,16 @@ gst_lame_src_link (GstPad * pad, const GstCaps * caps) !gst_structure_get_int (structure, "channels", &lame->num_channels)) g_return_val_if_reached (GST_PAD_LINK_REFUSED); + /* try sample rate */ + ratecaps = + gst_caps_new_simple ("audio/x-raw-int", + "channels", G_TYPE_INT, lame->num_channels, + "rate", G_TYPE_INT, out_samplerate, NULL); + result = gst_pad_try_set_caps (lame->srcpad, ratecaps); + gst_caps_free (ratecaps); + if (GST_PAD_LINK_FAILED (result)) + return result; + if (lame_set_out_samplerate (lame->lgf, out_samplerate) != 0) return GST_PAD_LINK_REFUSED;