diff --git a/isoparser/src/main/java/org/mp4parser/PropertyBoxParserImpl.java b/isoparser/src/main/java/org/mp4parser/PropertyBoxParserImpl.java index 14980cf32..b6b0747fe 100644 --- a/isoparser/src/main/java/org/mp4parser/PropertyBoxParserImpl.java +++ b/isoparser/src/main/java/org/mp4parser/PropertyBoxParserImpl.java @@ -45,15 +45,14 @@ public PropertyBoxParserImpl(String... customProperties) { if (BOX_MAP_CACHE != null) { mapping = new Properties(BOX_MAP_CACHE); } else { - InputStream is = ClassLoader.getSystemResourceAsStream("isoparser2-default.properties"); + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + if (cl == null) cl = ClassLoader.getSystemClassLoader(); + + InputStream is = cl.getResourceAsStream("isoparser2-default.properties"); try { mapping = new Properties(); try { mapping.load(is); - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - if (cl == null) { - cl = ClassLoader.getSystemClassLoader(); - } Enumeration enumeration = cl.getResources("isoparser-custom.properties"); while (enumeration.hasMoreElements()) {