Skip to content

Commit

Permalink
Correctly close reference in InputStream after extracting executable …
Browse files Browse the repository at this point in the history
…binary from jar
  • Loading branch information
a-schild committed Jan 15, 2020
1 parent d65b619 commit 7b64570
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 41 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# JAVE2

## Changelog
- **2.7.3**
- Close class reference when binary was extracted from jar file
- **2.7.2**
- Handle invalid/unknown duration values in containers
- **2.7.1**
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ It includes all binaries for the supported platforms
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-all-deps</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
```

Expand All @@ -60,7 +60,7 @@ Generally if you want to use for one platform or more what you have to do is add
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
```

Expand All @@ -71,7 +71,7 @@ and then the specific jar(s) for your platform(s) :
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
```

Expand All @@ -80,7 +80,7 @@ and then the specific jar(s) for your platform(s) :
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
```

Expand All @@ -89,7 +89,7 @@ and then the specific jar(s) for your platform(s) :
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
```

Expand All @@ -98,13 +98,13 @@ and then the specific jar(s) for your platform(s) :
It includes all binaries for the supported platforms

``` XML
compile group: 'ws.schild', name: 'jave-all-deps', version: '2.7.2'
compile group: 'ws.schild', name: 'jave-all-deps', version: '2.7.3'
```

### For one platform only (Linux 64Bit in this case)
``` XML
compile group: 'ws.schild', name: 'jave-core', version: '2.7.2'
compile group: 'ws.schild', name: 'jave-nativebin-linux64', version: '2.7.2'
compile group: 'ws.schild', name: 'jave-core', version: '2.7.3'
compile group: 'ws.schild', name: 'jave-nativebin-linux64', version: '2.7.3'
```

### Main Components of Jave2
Expand Down
14 changes: 7 additions & 7 deletions jave-all-deps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>2.7.2</version>
<version>2.7.3</version>
<artifactId>jave-all-deps</artifactId>
<name>Jave all native dependencies package</name>
<description>The JAVE (Java Audio Video Encoder) library is Java wrapper on the
Expand Down Expand Up @@ -152,32 +152,32 @@
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win32</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux32</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
Expand Down
14 changes: 7 additions & 7 deletions jave-core-test-java11/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>2.7.2</version>
<version>2.7.3</version>
<artifactId>jave-core-test-java11</artifactId>
<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down Expand Up @@ -38,32 +38,32 @@
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win32</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux32</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
Expand Down
14 changes: 7 additions & 7 deletions jave-core-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>2.7.2</version>
<version>2.7.3</version>
<artifactId>jave-core-test</artifactId>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down Expand Up @@ -38,32 +38,32 @@
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win32</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-win64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux32</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-osx64</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion jave-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<packaging>jar</packaging>
<version>2.7.2</version>
<version>2.7.3</version>
<name>Jave core package</name>
<description>The JAVE (Java Audio Video Encoder) library is Java wrapper on the
ffmpeg project. Developers can take take advantage of JAVE2 to transcode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class DefaultFFMPEGLocator extends FFMPEGLocator {
* Trace the version of the bundled ffmpeg executable. It's a counter: every
* time the bundled ffmpeg change it is incremented by 1.
*/
private static final String MY_EXE_VERSION = "2.7.2";
private static final String MY_EXE_VERSION = "2.7.3";

/**
* The ffmpeg executable file path.
Expand Down Expand Up @@ -154,6 +154,14 @@ private void copyFile(String path, File dest) {
{
LOG.error("Copy resource to target <{}> failed", dest.getAbsolutePath());
}
try
{
is.close();
}
catch (IOException ioex)
{
LOG.warn("Error in closing input stream", ioex);
}
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions jave-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>2.7.2</version>
<version>2.7.3</version>
<artifactId>jave-example</artifactId>
<properties>
<maven.compiler.source>12</maven.compiler.source>
Expand Down Expand Up @@ -66,12 +66,12 @@
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-core</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>ws.schild</groupId>
<artifactId>jave-nativebin-linux32</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion jave-nativebin-linux32/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>2.7.2</version>
<version>2.7.3</version>
<artifactId>jave-nativebin-linux32</artifactId>
<name>Jave linux 32 bit native package</name>
<description>The JAVE (Java Audio Video Encoder) library is Java wrapper on the
Expand Down
2 changes: 1 addition & 1 deletion jave-nativebin-linux64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>2.7.2</version>
<version>2.7.3</version>
<artifactId>jave-nativebin-linux64</artifactId>
<name>Jave linux 64 bit native package</name>
<description>The JAVE (Java Audio Video Encoder) library is Java wrapper on the
Expand Down
2 changes: 1 addition & 1 deletion jave-nativebin-osx64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>2.7.2</version>
<version>2.7.3</version>
<artifactId>jave-nativebin-osx64</artifactId>
<name>Jave OSX 64 bit native package</name>
<description>The JAVE (Java Audio Video Encoder) library is Java wrapper on the
Expand Down
2 changes: 1 addition & 1 deletion jave-nativebin-win32/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>2.7.2</version>
<version>2.7.3</version>
<artifactId>jave-nativebin-win32</artifactId>
<name>Jave windows 32 bit native package</name>
<description>The JAVE (Java Audio Video Encoder) library is Java wrapper on the
Expand Down
2 changes: 1 addition & 1 deletion jave-nativebin-win64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ws.schild</groupId>
<packaging>jar</packaging>
<version>2.7.2</version>
<version>2.7.3</version>
<artifactId>jave-nativebin-win64</artifactId>
<name>Jave windows 64 bit native package</name>
<description>The JAVE (Java Audio Video Encoder) library is Java wrapper on the
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<artifactId>jave-modules</artifactId>
<packaging>pom</packaging>
<properties>
<revision>2.7.2</revision>
<revision>2.7.3</revision>
<!-- Don't forget to change it also in DefaultFFMPEGLocator.java -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<version>2.7.2</version>
<version>2.7.3</version>
<name>Jave master project</name>
<description>Jave master project</description>
<url>https://github.com/a-schild/jave2</url>
Expand Down

0 comments on commit 7b64570

Please sign in to comment.