diff --git a/gst-sdk/tutorials/playback-tutorial-7.c b/gst-sdk/tutorials/playback-tutorial-7.c index da0570b003..2ccd06940e 100644 --- a/gst-sdk/tutorials/playback-tutorial-7.c +++ b/gst-sdk/tutorials/playback-tutorial-7.c @@ -1,7 +1,7 @@ #include int main(int argc, char *argv[]) { - GstElement *pipeline, *bin, *equalizer, *sink; + GstElement *pipeline, *bin, *equalizer, *convert, *sink; GstPad *pad, *ghost_pad; GstBus *bus; GstMessage *msg; @@ -14,16 +14,17 @@ int main(int argc, char *argv[]) { /* Create the elements inside the sink bin */ equalizer = gst_element_factory_make ("equalizer-3bands", "equalizer"); + convert = gst_element_factory_make ("audioconvert", "convert"); sink = gst_element_factory_make ("autoaudiosink", "audio_sink"); - if (!equalizer || !sink) { + if (!equalizer || !convert || !sink) { g_printerr ("Not all elements could be created.\n"); return -1; } /* Create the sink bin, add the elements and link them */ bin = gst_bin_new ("audio_sink_bin"); - gst_bin_add_many (GST_BIN (bin), equalizer, sink, NULL); - gst_element_link (equalizer, sink); + gst_bin_add_many (GST_BIN (bin), equalizer, convert, sink, NULL); + gst_element_link_many (equalizer, convert, sink, NULL); pad = gst_element_get_static_pad (equalizer, "sink"); ghost_pad = gst_ghost_pad_new ("sink", pad); gst_pad_set_active (ghost_pad, TRUE);