*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.
This commit is contained in:
imonroe 2006-10-01 13:54:24 +00:00
parent b0ee70d0bc
commit d3670bcb08
1 changed files with 7 additions and 6 deletions

View File

@ -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,