title: javaFX media crash in loop with because of ERROR_GSTREAMER_PIPELINE_STATE_CHANGE
body: <p>I can successfully play the media file, but when I play it in a loop, it always crashes after few seconds. I debugged it, and found original error is &quot;com.sun.media.jfxmedia.MediaError:ERROR_GSTREAMER_PIPELINE_STATE_CHANGE&quot;</p>
  <p>JDK15, language level:10, javafx 11</p>
  <pre><code>public static void main(String[] args) {
     String file =  new File(&quot;shoot.wav&quot;).toURI().toString();
      while (true) {
          Media media = new Media(file);
          MediaPlayer mediaPlayer = new MediaPlayer(media);
          mediaPlayer.play();
  
          try {
              Thread.sleep(50);
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
      }
  
  
  }
  </code></pre>
  <p>the exception:</p>
  <pre><code>Caused by: MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
  at javafx.media/javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146)
  at javafx.media/javafx.scene.media.MediaPlayer.init(MediaPlayer.java:518)
  at javafx.media/javafx.scene.media.MediaPlayer.&lt;init&gt;(MediaPlayer.java:421)
  at org.openjfx/org.openjfx.App.main(App.java:35)
  ... 11 more
  Caused by: com.sun.media.jfxmedia.MediaException: Could not create player!
  at javafx.media/com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:295)
  at javafx.media/com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:118)
  at javafx.media/javafx.scene.media.MediaPlayer.init(MediaPlayer.java:474)
  ... 13 more
  Exception running application org.openjfx.App
  </code></pre>