java-stream-player icon indicating copy to clipboard operation
java-stream-player copied to clipboard

Unused code

Open IARI opened this issue 6 years ago • 4 comments

I am currently trying to re-implement a player based on Javax.soundand thus trying to understand the implementation here, In the course of that process, I stumbled upon a piece of code that seems like it isn't used:

In the method createLine() The Assignment In StreamPlayer.java Line 481 makes the two assignments to sourceDataLine in L474 and L478 superfluos.

https://github.com/goxr3plus/java-stream-player/blob/2f7d16dcf689a5335e91fe91bd6bfbdfe173cd6e/src/main/java/goxr3plus/javastreamplayer/stream/StreamPlayer.java#L472-L481

If this kind of comment isn't helpful, or the code here isn't maintained anymore, please let me know - I might just stumble upon something else.

IARI avatar Mar 10 '19 08:03 IARI

This library is maintained by me and your issues are so so useful.

goxr3plus avatar Mar 10 '19 11:03 goxr3plus

What this code does is actually trying to get the specific Mixer, if we haven't gave one... i think we never give it has two different approaches of getting the SourceDataLine.... in the first one it gets it from the specific mixer where in the second it gets it directly from the AudioSystem.

I got this library which was in Java4 and passed it to Java8.

I understand it's hard understanding some parts of it so you can ask everything or even improve it, i can make you a collaborator :)

goxr3plus avatar Mar 10 '19 11:03 goxr3plus

Thank you for the offer of becoming a collaborator - I can however not guarantee that I can do any useful continued work on the repository. I am kind of trying to rewrite the player class in Kotlin currently - at least the parts that I need für my little project.

Another thing I noticed: The field private Future<Void> future; is never assigned a non-null value throughout the class - so that seems unused too. in the awaitTermination(); method it is used, but only if it is not null, which cannot be the case the way I understand it.

IARI avatar Mar 10 '19 13:03 IARI

Let me have a look at the code it's been time since i wrote it.

goxr3plus avatar Mar 10 '19 16:03 goxr3plus