[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: JavaFX 19 - Media object bug
From:       Alessandro Mercier <administrator () codedead ! com>
Date:       2022-09-15 16:24:34
Message-ID: CAEN8YAEFUA8MbCGvLH85jm-=eVnenES8G1hMwXJZfCjBoQNYHQ () mail ! gmail ! com
[Download RAW message or body]

Certainly,

A report has been filed.

Kind regards


On Thu, 15 Sep 2022, 18:11 Kevin Rushforth, <kevin.rushforth@oracle.com>
wrote:

> This might be a regression introduced by the fix for
> https://bugs.openjdk.org/browse/JDK-8282054
> 
> Can you file a bug at https://bugreport.java.com/ ?
> 
> Maybe Alexander can comment further.
> 
> -- Kevin
> 
> 
> On 9/15/2022 8:27 AM, Alessandro Mercier wrote:
> 
> Hello all,
> 
> After this commit:
> 
> https://github.com/openjdk/jfx/commit/d1110f479567c314ecb6848700bcf4552509d7e9
> 
> Creating a new Media object using a MP3 file in the resources of a
> project, you can get exceptions:
> 
> Exception in thread "JavaFX Application Thread" MediaException:
> MEDIA_UNSUPPORTED : Unrecognized file signature!
> at javafx.media@20-ea/javafx.scene.media.Media.<init>(Media.java:411)
> 
> At first glance, the error is in this Locator file in the JavaFX source
> code:
> 
> https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/java/com/sun/media/jfxmedia/locator/Locator.java
>  
> *Steps to reproduce the bug:*
> 1. Create a new Media object and load an MP3 from the resources
> 2. Watch the Media object throw a MediaException: MEDIA_UNSUPPORTED :
> Unrecognized file signature!
> 
> *Example code that produces the bug:*
> final MediaPlayer mediaPlayer = new MediaPlayer(new
> Media(getClass().getResource("/path/to/file.mp3").toExternalForm()));
> 
> *Extra:*
> I've made a free MP3 file available to try with here (royalty free):
> https://codedead.com/static.mp3
> 
> I've also got a GIT repository in which the exception occurs immediately
> when running the Gradle task 'application':
> https://github.com/CodeDead/opal/tree/development (please make sure to
> use the development branch as this branch makes use of the latest JavaFX
> versions)
> 
> Oddly enough, it does not always happen, and loading the file directly
> from a file location instead of the project resources seems to work, but
> when loading from the resources, you get the exception that the media file
> signature is not recognized.
> I don't see a problem with the media files themselves, encoding is all
> fine, at first glance and because it worked in JavaFX 18.0.2, creating a
> Media object using a URI to a project resources location should work in
> newer versions as well, I think. The same MP3 file does work when you load
> it from the disk instead of the project resources so this makes it a bug, I
> believe.
> 
> The work-around right now is to revert back to JavaFX version 18.0.2.
> 
> *System / OS / Runtime info:*
> Linux Fedora 36
> 5.19.8-200.fc36.x86_64
> openjdk version "18.0.2" 2022-07-19
> OpenJDK Runtime Environment (Red_Hat-18.0.2.0.9-1.rolling.fc36) (build
> 18.0.2+9)
> OpenJDK 64-Bit Server VM (Red_Hat-18.0.2.0.9-1.rolling.fc36) (build
> 18.0.2+9, mixed mode, sharing)
> 
> Thank you and kind regards
> 
> Alessandro Mercier
> --
> CodeDead Administrator
> https://codedead.com/
> 
> 
> 


[Attachment #3 (text/html)]

<div dir="auto"><div>Certainly,<div dir="auto"><br></div><div dir="auto">A report has \
been filed.</div><div dir="auto"><br></div><div dir="auto">Kind \
regards</div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On \
Thu, 15 Sep 2022, 18:11 Kevin Rushforth, &lt;<a \
href="mailto:kevin.rushforth@oracle.com">kevin.rushforth@oracle.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">

  
  <div>
    This might be a regression introduced by the fix for
    <a href="https://bugs.openjdk.org/browse/JDK-8282054" target="_blank" \
rel="noreferrer">https://bugs.openjdk.org/browse/JDK-8282054</a><br>  <br>
    Can you file a bug at <a href="https://bugreport.java.com/" target="_blank" \
rel="noreferrer">https://bugreport.java.com/</a> ?<br>  <br>
    Maybe Alexander can comment further.<br>
    <br>
    -- Kevin<br>
    <br>
    <br>
    <div>On 9/15/2022 8:27 AM, Alessandro
      Mercier wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Hello all,
        <div><br>
        </div>
        <div>After this commit:<br>
          <a href="https://github.com/openjdk/jfx/commit/d1110f479567c314ecb6848700bcf4552509d7e9" \
target="_blank" rel="noreferrer">https://github.com/openjdk/jfx/commit/d1110f479567c314ecb6848700bcf4552509d7e9</a><br>
  <br>
          Creating a new Media object using a MP3 file in the resources
          of a project, you can get exceptions:<br>
          <br>
          Exception in thread &quot;JavaFX Application Thread&quot;
          MediaException: MEDIA_UNSUPPORTED : Unrecognized file
          signature!<br>
          at
          <a href="mailto:javafx.media@20-ea/javafx.scene.media.Media" \
target="_blank" rel="noreferrer">javafx.media@20-ea/javafx.scene.media.Media</a>.&lt;init&gt;(Media.java:411)<br>
  <br>
          At first glance, the error is in this Locator file in the
          JavaFX source code:<br>
          <a href="https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/java/com/sun/media/jfxmedia/locator/Locator.java" \
target="_blank" rel="noreferrer">https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/java/com/sun/media/jfxmedia/locator/Locator.java</a><br>
  </div>
        <div><br>
        </div>
        <div><b>Steps to reproduce the bug:</b></div>
        <div>1. Create a new Media object and load an MP3 from the
          resources<br>
          2. Watch the Media object throw a MediaException:
          MEDIA_UNSUPPORTED : Unrecognized file signature!</div>
        <div><br>
        </div>
        <div><b>Example code that produces the bug:</b></div>
        <div>final MediaPlayer mediaPlayer = new MediaPlayer(new
          Media(getClass().getResource(&quot;/path/to/file.mp3&quot;).toExternalForm()));<br>
  <br>
          <b>Extra:</b><br>
          I&#39;ve made a free MP3 file available to try with here (royalty
          free):<br>
          <a href="https://codedead.com/static.mp3" target="_blank" \
rel="noreferrer">https://codedead.com/static.mp3</a><br>  <br>
          I&#39;ve also got a GIT repository in which the exception occurs
          immediately when running the Gradle task &#39;application&#39;:<br>
          <a href="https://github.com/CodeDead/opal/tree/development" target="_blank" \
rel="noreferrer">https://github.com/CodeDead/opal/tree/development</a>  (please make \
sure to use the development branch as this branch  makes use of the latest JavaFX \
versions)</div>  <div><br>
          Oddly enough, it does not always happen, and loading the file
          directly from a file location instead of the project resources
          seems to work, but when loading from the resources, you get
          the exception that the media file signature is not recognized.<br>
        </div>
        <div>I don&#39;t see a problem with the media files themselves,
          encoding is all fine, at first glance and because it worked in
          JavaFX 18.0.2, creating a Media object using a URI to a
          project resources location should work in newer versions as
          well, I think. The same MP3 file does work when you load it
          from the disk instead of the project  resources so this makes
          it a bug, I believe.<br>
        </div>
        <div><br>
        </div>
        <div>The work-around right now is to revert back to JavaFX
          version 18.0.2.</div>
        <div><br>
        </div>
        <div><b>System / OS / Runtime info:</b></div>
        <div>Linux Fedora 36<br>
          5.19.8-200.fc36.x86_64<br>
          openjdk version &quot;18.0.2&quot; 2022-07-19<br>
          OpenJDK Runtime Environment
          (Red_Hat-18.0.2.0.9-1.rolling.fc36) (build 18.0.2+9)<br>
          OpenJDK 64-Bit Server VM (Red_Hat-18.0.2.0.9-1.rolling.fc36)
          (build 18.0.2+9, mixed mode, sharing)<br>
        </div>
        <div>
          <div><br>
          </div>
          <div>Thank you and kind regards</div>
          <div><br>
          </div>
          <div>Alessandro Mercier</div>
          -- <br>
          <div dir="ltr" data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>CodeDead Administrator<br>
              </div>
              <div><a href="https://codedead.com/" target="_blank" \
rel="noreferrer">https://codedead.com/</a></div>  <div><br>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic