JDK-8210828 : MediaPlayer not playing mp3 files with photoshopped album art
  • Type: Bug
  • Component: javafx
  • Sub-Component: media
  • Affected Version: 9,10,openjfx11
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: x86_64
  • Submitted: 2018-09-13
  • Updated: 2019-04-16
  • Resolved: 2019-04-16
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Windows 10 version 1803
Java 10.0.2

A DESCRIPTION OF THE PROBLEM :
I have a small JavaFX application to test MediaPlayer with mp3 files. The code is available at my stackoverflow question here https://stackoverflow.com/questions/52312007/javafx-mediaplayer-not-playing-with-jdk-10
I have narrowed down the issue to the album art of the mp3 which was generated from photoshop (cos sometimes I photoshop album art). The code works with other mp3 files that doesnt have album art or the album art wasnt photoshopped. Furthermore, this issue doesnt exist for Java 8.

REGRESSION : Last worked in version 8u181

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Download the following files:
- sample mp3 with original album art (haikei.mp3) https://drive.google.com/file/d/1WIc57GH4m3GTCFOeqrxMH7n0iLQJWmIH/view?usp=sharing
- extracted original album art (haikei.jpg) https://drive.google.com/file/d/19c9Dckk8Fi4fL5dmlOMaEA9DEGg6uorw/view?usp=sharing
- photoshopped album art (haikei2.jpg) https://drive.google.com/file/d/10FbsjEwCd81rRetHvCheCTlDjisTm3mR/view?usp=sharing
- sample mp3 with photoshopped album art (haikei2.mp3) https://drive.google.com/file/d/1s9L5HQ1IQkp1zU_Jr8eaWucSkqZhhgLd/view?usp=sharing

Change line 20 to either "haikei.mp3" to "haikei2.mp3"
Open terminal and enter javac Main.java --add-modules=javafx.media,javafx.graphics
Then run by entering java Main

If you used "haikei.mp3", a small window will open and there is audio playing.
If you used "haikei2.mp3", a small window will open but there is no audio playing.

Tools used:
Mp3Tag v2.85 (for album art extraction and insertion)
Adobe Photoshop CC 19.1.2

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
haikei2.mp3 should be playing
ACTUAL -
haikei2.mp3 is not playing

---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.media.Media;
import javafx.scene.Scene;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
import javafx.stage.Stage;
import java.io.File;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Hello World");
        Group root = new Group();
        Scene scene = new Scene(root, 300, 275);
        primaryStage.setScene(scene);
        primaryStage.sizeToScene();
        primaryStage.show();
        String bip = "haikei2.mp3"; // "haikei.mp3"
        Media hit = new Media(new File(bip).toURI().toString());
        MediaPlayer mediaPlayer = new MediaPlayer(hit);
        mediaPlayer.setAutoPlay(true);
        MediaView mediaView = new MediaView(mediaPlayer);
        ((Group)scene.getRoot()).getChildren().add(mediaView);
    }

    public static void main(String[] args) {
        launch(args);
    }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
use JDK 8


Comments
This is duplicate of JDK-8213510.
16-04-2019

Can compile the provided test case using JDK 10.0.2 without using any runtime options unlike submitter. Also issue is reproducible in JDK 9 and latest openjfx build. Its a regression between JDK 1.9.0- b60 - 1.9.0-b80. 8u181-b13 : Pass 8u192-b06 : Fail 1.9.0-b60 : Pass 1.9.0-b80 : Fail 10.0.2 : Fail Latest openjfx : Fail
17-09-2018

This may be a regression caused by the upgrade to GStreamer 1.14, which went into JDK 9, and recently was backported to JDK 8u192 (in b02). See JDK-8199527.
17-09-2018