Fix bug not loading engine

This commit is contained in:
Jonas Kvinge
2018-10-17 22:55:36 +02:00
parent a8a714c820
commit a9e905b301
5 changed files with 24 additions and 17 deletions

View File

@@ -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);

View File

@@ -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();
}