*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:
parent
b0ee70d0bc
commit
d3670bcb08
1 changed files with 7 additions and 6 deletions
|
@ -245,11 +245,13 @@ GstreamerPlayer :: open(const std::string fileUrl)
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fileUrl.find("file:") == 0) {
|
if (fileUrl.find("file://") == 0) {
|
||||||
filePath = fileUrl.substr(5, fileUrl.size());
|
|
||||||
} else if (fileUrl.find("file://") == 0) {
|
|
||||||
filePath = fileUrl.substr(7, fileUrl.size());
|
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");
|
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);
|
volume = gst_element_factory_make("volume", NULL);
|
||||||
g_object_set(G_OBJECT(volume), "volume", gdouble(0.8), 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, NULL);
|
||||||
gst_element_link_many(decoder, volume, audiosink);
|
|
||||||
gst_bin_add_many(GST_BIN(pipeline), filesrc,
|
gst_bin_add_many(GST_BIN(pipeline), filesrc,
|
||||||
decoder,
|
decoder,
|
||||||
volume,
|
volume,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue