From d3670bcb0881e0c89f900ea51a156813e1b3cb8e Mon Sep 17 00:00:00 2001 From: imonroe Date: Sun, 1 Oct 2006 13:54:24 +0000 Subject: [PATCH] *Fixed crash caused by gst_element_link_many not having a last NULL agrument, fixing ticket #1827. *The code to take the 'file://' was out of order from URLs passed to open was out of order. --- .../playlistExecutor/src/GstreamerPlayer.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/livesupport/src/modules/playlistExecutor/src/GstreamerPlayer.cxx b/livesupport/src/modules/playlistExecutor/src/GstreamerPlayer.cxx index 1dcd05d01..78ecddfbb 100644 --- a/livesupport/src/modules/playlistExecutor/src/GstreamerPlayer.cxx +++ b/livesupport/src/modules/playlistExecutor/src/GstreamerPlayer.cxx @@ -245,11 +245,13 @@ GstreamerPlayer :: open(const std::string fileUrl) close(); } - if (fileUrl.find("file:") == 0) { - filePath = fileUrl.substr(5, fileUrl.size()); - } else if (fileUrl.find("file://") == 0) { + if (fileUrl.find("file://") == 0) { filePath = fileUrl.substr(7, fileUrl.size()); - } else { + } + else if (fileUrl.find("file:") == 0) { + filePath = fileUrl.substr(5, fileUrl.size()); + } + else { throw std::invalid_argument("badly formed URL or unsupported protocol"); } @@ -293,8 +295,7 @@ GstreamerPlayer :: open(const std::string fileUrl) volume = gst_element_factory_make("volume", NULL); g_object_set(G_OBJECT(volume), "volume", gdouble(0.8), NULL); - // connect the decoder to the real audio sink, through the volume element - gst_element_link_many(decoder, volume, audiosink); + gst_element_link_many(decoder, volume, audiosink, NULL); gst_bin_add_many(GST_BIN(pipeline), filesrc, decoder, volume,