Open HelgeStenstrom opened 2 years ago
What is the purpose of Status.OPENING? It seems to be written to status, but never read.
https://github.com/goxr3plus/java-stream-player/blob/7caf2f34fafd1504f25c9910750e841469f66a07/src/main/java/com/goxr3plus/streamplayer/stream/StreamPlayer.java#L333-L335
There seem to be three values in Status that are never used; neither for write nor for read: INIT, BUFFERING and GAIN. I think they can be removed.
In the play() method, the status is tested. It returns silently if status != Status.OPENED. Is that a desirable feature?
https://github.com/goxr3plus/java-stream-player/blob/7caf2f34fafd1504f25c9910750e841469f66a07/src/main/java/com/goxr3plus/streamplayer/stream/StreamPlayer.java#L554-L572
That is why https://github.com/goxr3plus/java-stream-player/blob/7caf2f34fafd1504f25c9910750e841469f66a07/src/test/java/com/goxr3plus/streamplayer/stream/StreamPlayerFutureImprovementTest.java#L49-L54 fails. What is the best alternative: Changing the behaviour to make the test pass, or remove the test?
OK, there is a third alternative: to change the behaviour such that the error situation is indicated by some other means, and change the test correspondingly.
What is the purpose of Status.OPENING? It seems to be written to status, but never read.
https://github.com/goxr3plus/java-stream-player/blob/7caf2f34fafd1504f25c9910750e841469f66a07/src/main/java/com/goxr3plus/streamplayer/stream/StreamPlayer.java#L333-L335
There seem to be three values in Status that are never used; neither for write nor for read: INIT, BUFFERING and GAIN. I think they can be removed.
In the play() method, the status is tested. It returns silently if status != Status.OPENED. Is that a desirable feature?
https://github.com/goxr3plus/java-stream-player/blob/7caf2f34fafd1504f25c9910750e841469f66a07/src/main/java/com/goxr3plus/streamplayer/stream/StreamPlayer.java#L554-L572
That is why https://github.com/goxr3plus/java-stream-player/blob/7caf2f34fafd1504f25c9910750e841469f66a07/src/test/java/com/goxr3plus/streamplayer/stream/StreamPlayerFutureImprovementTest.java#L49-L54 fails. What is the best alternative: Changing the behaviour to make the test pass, or remove the test?
OK, there is a third alternative: to change the behaviour such that the error situation is indicated by some other means, and change the test correspondingly.