From f5f9db7ba8f03c3fc836932097c5e4cc76bee8d1 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 31 Oct 2006 17:08:07 +0000 Subject: [PATCH] Remove dubious code block from open(), that would try to play the pipeline on a fakesink. Currently this servers no purpose, but it just makes opening files slower. Refer to #1904 --- .../playlistExecutor/src/GstreamerPlayer.cxx | 30 ++----------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx index 5ad69e432..9ad3dde89 100644 --- a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx +++ b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx @@ -252,17 +252,14 @@ GstreamerPlayer :: open(const std::string fileUrl) DEBUG_BLOCK - std::string filePath; - GstElement * pipe; - GstElement * fakesink; - gint64 position; - if (isOpen()) { close(); } debug() << "Opening URL: " << fileUrl << endl; + std::string filePath; + if (fileUrl.find("file://") == 0) { filePath = fileUrl.substr(7, fileUrl.size()); } @@ -282,29 +279,6 @@ GstreamerPlayer :: open(const std::string fileUrl) throw std::invalid_argument(std::string("can't open URL ") + fileUrl); } - // connect the decoder unto a fakesink, and iterate on it until the - // first bytes come out. this is to make sure that _really_ all - // initialiation is done at opening - pipe = gst_pipeline_new("pipe"); - fakesink = gst_element_factory_make("fakesink", "fakesink"); - gst_object_ref(GST_OBJECT(filesrc)); - gst_object_ref(GST_OBJECT(decoder)); - gst_element_link_many(decoder, fakesink, NULL); - gst_bin_add_many(GST_BIN(pipe), filesrc, decoder, fakesink, NULL); - - gst_element_set_state(pipe, GST_STATE_PLAYING); - - position = 0LL; - while (position == 0LL && gst_bin_iterate(GST_BIN(pipe))) { - GstFormat format = GST_FORMAT_DEFAULT; - gst_element_query(fakesink, GST_QUERY_POSITION, &format, &position); - } - - gst_element_set_state(pipe, GST_STATE_PAUSED); - gst_bin_remove_many(GST_BIN(pipe), filesrc, decoder, NULL); - gst_element_unlink(decoder, fakesink); - gst_object_unref(GST_OBJECT(pipe)); - // converts between different audio formats (e.g. bitrate) audioconvert = gst_element_factory_make("audioconvert", NULL);