Fix bug not loading engine
This commit is contained in:
@@ -69,14 +69,17 @@ bool VLCEngine::Init() {
|
||||
|
||||
// Create the VLC instance
|
||||
instance_ = libvlc_new(sizeof(args) / sizeof(*args), args);
|
||||
if (!instance_) return false;
|
||||
HandleErrors();
|
||||
|
||||
// Create the media player
|
||||
player_ = libvlc_media_player_new(instance_);
|
||||
if (!player_) return false;
|
||||
HandleErrors();
|
||||
|
||||
// Add event handlers
|
||||
libvlc_event_manager_t *player_em = libvlc_media_player_event_manager(player_);
|
||||
if (!player_em) return false;
|
||||
HandleErrors();
|
||||
|
||||
AttachCallback(player_em, libvlc_MediaPlayerEncounteredError, StateChangedCallback);
|
||||
|
||||
@@ -121,9 +121,10 @@ bool XineEngine::Init() {
|
||||
qLog(Error) << "Invalid output detected:" << output_ << " - Resetting to default.";
|
||||
output_ = DefaultOutput();
|
||||
}
|
||||
|
||||
audioport_ = xine_open_audio_driver(xine_, (output_.isEmpty() || output_ == kAutoOutput ? nullptr : output_.toUtf8().constData()), nullptr);
|
||||
if (!audioport_) {
|
||||
emit Error("Xine was unable to initialize any audio drivers.");
|
||||
qLog(Error) << "Xine was unable to initialize any audio drivers.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -353,7 +354,7 @@ void XineEngine::ReloadSettings() {
|
||||
|
||||
Engine::Base::ReloadSettings();
|
||||
|
||||
if (output_ == "") output_ = DefaultOutput();
|
||||
if (output_.isEmpty()) output_ = DefaultOutput();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user