Skip to content

Commit

Permalink
fixed unintended crashes on VLC loading fail
Browse files Browse the repository at this point in the history
  • Loading branch information
SrRapero720 committed Jun 16, 2024
1 parent 3963b02 commit 366ccae
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public final boolean discover() {
return true;
} else {
// WATERMeDIA PATCH - start
LOGGER.error(IT, "Failed loading VLC in '{}' using '{}' cleaning JNA", path, discoveryStrategy.getClass().getSimpleName());
LOGGER.error(IT, "Failed loading VLC in '{}' using '{}' cleaning JNA and trying again...", path, discoveryStrategy.getClass().getSimpleName());
if (attemptFix()) continue;
// WATERMeDIA PATCH - end

Expand Down Expand Up @@ -234,8 +234,7 @@ private boolean tryLoadingLibrary() {
return true;
}
}
}
catch (UnsatisfiedLinkError e) {
} catch (Error e) {
// The library could not be loaded, this includes NoClassDefFoundError which would be thrown e.g. if there
// was a direct-mapped method in the LibVlc class that was missing from the loaded native library - we don't
// report the error here (since this discovery is optional), it will be reported by the factory subsequently
Expand Down Expand Up @@ -268,12 +267,14 @@ protected void onFound(String path, NativeDiscoveryStrategy strategy) {
* @param strategy discovery strategy that found, but failed to load, the native library
*/
protected void onFailed(String path, NativeDiscoveryStrategy strategy) {
LOGGER.error(IT, "Failed to load VLC on path '{}' using strategy '{}'", path, strategy.getClass().getSimpleName());
}

/**
* Template method invoked if the native libraries could not be found by any known discovery strategy.
*/
protected void onNotFound() {
LOGGER.error(IT, "VLC was not found");
}

}

0 comments on commit 366ccae

Please sign in to comment.