- if (is_AudioCD)
- {
- queue_audio = gst_element_factory_make("queue", "queue_audio");
- g_object_set (G_OBJECT (sink), "preroll-queue-len", 80, NULL);
- gst_bin_add_many (GST_BIN (m_gst_pipeline), source, queue_audio, conv, sink, NULL);
- gst_element_link_many(source, queue_audio, conv, sink, NULL);
- }
- else if (is_audio)
- {
- queue_audio = gst_element_factory_make("queue", "queue_audio");
-
- if (!is_mp3)
- {
- /* decodebin has dynamic pads. When they get created, we connect them to the audio bin */
- g_signal_connect (decoder, "new-decoded-pad", G_CALLBACK(gstCBnewPad), this);
- g_signal_connect (decoder, "unknown-type", G_CALLBACK(gstCBunknownType), this);
- g_object_set (G_OBJECT (sink), "preroll-queue-len", 80, NULL);
- }
-
- /* gst_bin will take the 'floating references' */
- gst_bin_add_many (GST_BIN (m_gst_pipeline),
- source, queue_audio, decoder, NULL);
-
- if (filter)
- {
- /* id3demux also has dynamic pads, which need to be connected to the decoder (this is done in the 'gstCBfilterPadAdded' CB) */
- gst_bin_add(GST_BIN(m_gst_pipeline), filter);
- gst_element_link(source, filter);
- m_decoder = decoder;
- g_signal_connect (filter, "pad-added", G_CALLBACK(gstCBfilterPadAdded), this);
- } else
- /* in decodebin's case we can just connect the source with the decodebin, and decodebin will take care about id3demux (or whatever is required) */
- gst_element_link_many(source, queue_audio, decoder, NULL);
-
- /* create audio bin with the audioconverter, the capsfilter and the audiosink */
- m_gst_audio = gst_bin_new ("audiobin");
-
- GstPad *audiopad = gst_element_get_static_pad (conv, "sink");
- gst_bin_add_many(GST_BIN(m_gst_audio), conv, flt, sink, (char*)0);
- gst_element_link_many(conv, flt, sink, (char*)0);
- gst_element_add_pad(m_gst_audio, gst_ghost_pad_new ("sink", audiopad));
- gst_object_unref(audiopad);
- gst_bin_add (GST_BIN(m_gst_pipeline), m_gst_audio);
-
- /* in mad's case, we can directly connect the decoder to the audiobin. otherwise, we do this in gstCBnewPad */
- if (is_mp3)
- gst_element_link(decoder, m_gst_audio);
- } else /* is_video */