-
Bug
-
Resolution: Unresolved
-
P3
-
jfx21, jfx25
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
Streaming a large wave file via http(s):
GSTMediaPlayer native code (https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstMediaPlayer.cpp)
reads data into buffer calling the ConnectionHolder.readNextBlock method:
https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/java/com/sun/media/jfxmedia/locator/ConnectionHolder.java#L78
1.) If this method throws an IOException (e.g. connection lost), the GSTMediaPlayer stucks in PLAYING status forever. The MediaPlayer.getCurrentTime() shows there is no playing progress anymore, though the status is still "PLAYING" and the onError listener is not executed.
2.) If this method doesn't provide any data anymore (e.g. backend is stalling) the GSTMediaPlayer stucks in PLAYING state, even if the buffer is empty and MediaPlayer.getCurrentTime() shows there is no playing progress anymore. It should transition to STALLED.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Streaming a large wave file via http(s):
GSTMediaPlayer native code (https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstMediaPlayer.cpp)
reads data into buffer calling the ConnectionHolder.readNextBlock method:
https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/java/com/sun/media/jfxmedia/locator/ConnectionHolder.java#L78
1.) If this method throws an IOException (e.g. connection lost), the GSTMediaPlayer stucks in PLAYING status forever. The MediaPlayer.getCurrentTime() shows there is no playing progress anymore, though the status is still "PLAYING" and the onError listener is not executed.
2.) If this method doesn't provide any data anymore (e.g. backend is stalling) the GSTMediaPlayer stucks in PLAYING state, even if the buffer is empty and MediaPlayer.getCurrentTime() shows there is no playing progress anymore. It should transition to STALLED.
Start streaming a large wave file via http:
Media media = new Media("http://localhost:80/large.wav");
MediaPlayer mediaPlayer = new MediaPlayer(media);
mediaPlayer.setOnError(() -> log.error("Error", mediaPlayer.getError()));
mediaPlayer.setOnStalled(() -> log.error("Stalled");
mediaPlayer.play();
After playing started, stop the backend. Wait until the sound stops. Neither the onError nor the onStalled handler is getting called.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
ErrorHandler is getting called on IOException. Or onStalled handler is called if you just stall the backend.
ACTUAL -
No handlers are getting called. If you call mediaPlayer.getStatus() it still shows PLAYING.
Streaming a large wave file via http(s):
GSTMediaPlayer native code (https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstMediaPlayer.cpp)
reads data into buffer calling the ConnectionHolder.readNextBlock method:
https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/java/com/sun/media/jfxmedia/locator/ConnectionHolder.java#L78
1.) If this method throws an IOException (e.g. connection lost), the GSTMediaPlayer stucks in PLAYING status forever. The MediaPlayer.getCurrentTime() shows there is no playing progress anymore, though the status is still "PLAYING" and the onError listener is not executed.
2.) If this method doesn't provide any data anymore (e.g. backend is stalling) the GSTMediaPlayer stucks in PLAYING state, even if the buffer is empty and MediaPlayer.getCurrentTime() shows there is no playing progress anymore. It should transition to STALLED.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Streaming a large wave file via http(s):
GSTMediaPlayer native code (https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstMediaPlayer.cpp)
reads data into buffer calling the ConnectionHolder.readNextBlock method:
https://github.com/openjdk/jfx/blob/master/modules/javafx.media/src/main/java/com/sun/media/jfxmedia/locator/ConnectionHolder.java#L78
1.) If this method throws an IOException (e.g. connection lost), the GSTMediaPlayer stucks in PLAYING status forever. The MediaPlayer.getCurrentTime() shows there is no playing progress anymore, though the status is still "PLAYING" and the onError listener is not executed.
2.) If this method doesn't provide any data anymore (e.g. backend is stalling) the GSTMediaPlayer stucks in PLAYING state, even if the buffer is empty and MediaPlayer.getCurrentTime() shows there is no playing progress anymore. It should transition to STALLED.
Start streaming a large wave file via http:
Media media = new Media("http://localhost:80/large.wav");
MediaPlayer mediaPlayer = new MediaPlayer(media);
mediaPlayer.setOnError(() -> log.error("Error", mediaPlayer.getError()));
mediaPlayer.setOnStalled(() -> log.error("Stalled");
mediaPlayer.play();
After playing started, stop the backend. Wait until the sound stops. Neither the onError nor the onStalled handler is getting called.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
ErrorHandler is getting called on IOException. Or onStalled handler is called if you just stall the backend.
ACTUAL -
No handlers are getting called. If you call mediaPlayer.getStatus() it still shows PLAYING.