Remove gstreamer registry file on startup for Windows
Workaround for issue #266
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
#include <QFuture>
|
#include <QFuture>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QFile>
|
||||||
|
|
||||||
#include "core/utilities.h"
|
#include "core/utilities.h"
|
||||||
|
|
||||||
@@ -61,16 +62,21 @@ void GstStartup::InitialiseGStreamer() {
|
|||||||
|
|
||||||
void GstStartup::SetEnvironment() {
|
void GstStartup::SetEnvironment() {
|
||||||
|
|
||||||
|
QString gio_path;
|
||||||
QString scanner_path;
|
QString scanner_path;
|
||||||
QString plugin_path;
|
QString plugin_path;
|
||||||
QString registry_filename;
|
QString registry_filename;
|
||||||
|
|
||||||
// On Windows and macOS we bundle the gstreamer plugins with strawberry
|
// On Windows and macOS we bundle the gstreamer plugins with strawberry
|
||||||
#ifdef USE_BUNDLE
|
#ifdef USE_BUNDLE
|
||||||
|
#if defined(Q_OS_WIN32) || defined(Q_OS_MACOS)
|
||||||
|
gio_path = QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR + "/gio-modules";
|
||||||
|
#endif
|
||||||
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
|
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
|
||||||
scanner_path = QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR + "/gst-plugin-scanner";
|
scanner_path = QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR + "/gst-plugin-scanner";
|
||||||
plugin_path = QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR + "/gstreamer";
|
plugin_path = QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR + "/gstreamer";
|
||||||
#elif defined(Q_OS_WIN32)
|
#endif
|
||||||
|
#if defined(Q_OS_WIN32)
|
||||||
plugin_path = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + "/gstreamer-plugins");
|
plugin_path = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + "/gstreamer-plugins");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -79,6 +85,11 @@ void GstStartup::SetEnvironment() {
|
|||||||
registry_filename = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QString("/gst-registry-%1-bin").arg(QCoreApplication::applicationVersion());
|
registry_filename = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QString("/gst-registry-%1-bin").arg(QCoreApplication::applicationVersion());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!gio_path.isEmpty()) {
|
||||||
|
//Utilities::SetEnv("GIO_MODULE_DIR", gio_path);
|
||||||
|
Utilities::SetEnv("GIO_EXTRA_MODULES", gio_path);
|
||||||
|
}
|
||||||
|
|
||||||
if (!scanner_path.isEmpty()) Utilities::SetEnv("GST_PLUGIN_SCANNER", scanner_path);
|
if (!scanner_path.isEmpty()) Utilities::SetEnv("GST_PLUGIN_SCANNER", scanner_path);
|
||||||
|
|
||||||
if (!plugin_path.isEmpty()) {
|
if (!plugin_path.isEmpty()) {
|
||||||
@@ -88,13 +99,15 @@ void GstStartup::SetEnvironment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!registry_filename.isEmpty()) {
|
if (!registry_filename.isEmpty()) {
|
||||||
|
#ifdef Q_OS_WIN32 // Workaround for issue #266 - TLS/SSL support not available; install glib-networking
|
||||||
|
QFile registry_file(registry_filename);
|
||||||
|
if (registry_file.exists()) {
|
||||||
|
registry_file.remove();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
Utilities::SetEnv("GST_REGISTRY", registry_filename);
|
Utilities::SetEnv("GST_REGISTRY", registry_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_MACOS) && defined(USE_BUNDLE)
|
|
||||||
Utilities::SetEnv("GIO_EXTRA_MODULES", QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR + "/gio-modules");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Utilities::SetEnv("PULSE_PROP_media.role", "music");
|
Utilities::SetEnv("PULSE_PROP_media.role", "music");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user