JDK-8250238 : Media fails to load libav 58 library when using modules from maven central
  • Type: Bug
  • Component: javafx
  • Sub-Component: media
  • Affected Version: openjfx13
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-07-23
  • Updated: 2020-08-25
  • Resolved: 2020-07-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
openjfx11.0.9Fixed
Related Reports
Relates :  
Description
When running a JavaFX application using the JavaFX modules from maven central, the native libraries are packed into the jar file, and then unpacked as needed by the JavaFX runtime. This fails for libavplugin-ffmpeg-58.so.

To reproduce this, run any media program using the modules from maven central on an Ubuntu 20.04 system that has the libavformat58 / libavcodec58 packages installed. The FX media library will fail to load the libavplugin-ffmpeg-58 support library.

When support for libav 58 was added by JDK-8215894, the new libavplugin-ffmpeg-58 library was not added to the list of dependent libraries of jfxmedia in NativeMediaManager.java. See:

https://github.com/openjdk/jfx/blob/14-ga/modules/javafx.media/src/main/java/com/sun/media/jfxmediaimpl/NativeMediaManager.java#L118
Comments
As a note, I discovered this by code inspection while answering the following question asked in an issue on the old javafxports/openjdk-jfx issue tracker: https://github.com/javafxports/openjdk-jfx/issues/635 I then verified that it failed before this fix and now works after this fix.
24-07-2020

Changeset: 6b008925 Author: Kevin Rushforth <kcr@openjdk.org> Date: 2020-07-24 12:08:46 +0000 URL: https://git.openjdk.java.net/jfx/commit/6b008925
24-07-2020

The fix is to simply add the missing line to the table in NativeMediaManager.java: dependencies.add("avplugin-ffmpeg-58");
23-07-2020