DV8FromTheWorld / JDA-Player

Extension library for JDA (or D4J) that provides an Java wrapping of Youtube-dl, FFmpeg and FFprobe for use as an AudioProvider.
Apache License 2.0
14 stars 5 forks source link

Calling stop() or skipToNext() throws an error #18

Closed GabrielOlvH closed 7 years ago

GabrielOlvH commented 7 years ago

Every time I use one of both, it throws this exception: [15:10:02] [Fatal] [JDAPlayer]: Encountered an exception: [15:10:02] [Fatal] [JDAPlayer]: java.io.IOException: Broken pipe at java.io.FileOutputStream.writeBytes(Native Method) at java.io.FileOutputStream.write(FileOutputStream.java:326) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126) at net.dv8tion.jda.player.source.RemoteStream$1.run(RemoteStream.java:76) And once in a while it throws these two: 13:07:02] [Fatal] [JDAPlayer]: Encountered an exception: [13:07:02] [Fatal] [JDAPlayer]: java.io.IOException: Stream closed at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:170) at java.io.BufferedInputStream.read1(BufferedInputStream.java:291) at java.io.BufferedInputStream.read(BufferedInputStream.java:345) at java.io.FilterInputStream.read(FilterInputStream.java:107) at net.dv8tion.jda.player.source.RemoteStream$3.run(RemoteStream.java:150) and [12:55:50] [Warning] [JDAPlayer]: ERR YTDL: ERROR: unable to write data: [Errno 32] Broken pipe

And I am using the latest version.

DV8FromTheWorld commented 7 years ago

Forgive me, but i find it hard to believe that you're using the latest version. The first error is very clearly fixed here: RemoteStream#L84

The second error has to do with us still outputting the Stream closed error for the stderr of the FFmpeg.

The last error has to do with YT-DL and livestreams I believe. If you load a livestream into RemoteSource, YT-DL will bypass JDA-Player and access FFmpeg directly. Can lead to errors.

The last 2 errors will be cleaned up when JDA-Player gets an rewrite immediately following the completion of JDA 3.x. The first error is fixed by updating JDA-Player tot he latest version.

GabrielOlvH commented 7 years ago

The exception points to this line: `while(!this.isInterrupted() && (msg2 = fromYTDL.read(e)) > -1) {

/this one/ toFFmpeg.write(e, 0, msg2); }` And I checked and I'm using the latest version http://imgur.com/a/kVRgI. Sorry if I'm bothering.

DV8FromTheWorld commented 7 years ago

I know the line it points to, but notice that it is inside of a try catch? and that the exception is handled in the try catch?

Also, by using both jda-player-withDependencies and JDA-withDependencies you are having files overwrite eachother as jda-player-withDependencies contains JDA. I would really recommend you use Gradle to handle your dependencies. (or maven)

As far as the version issue, I don't know why you're still getting this error. No one else is reporting this error anymore after the fix went out.

GabrielOlvH commented 7 years ago

I recoded my music bot and I still have this error. `

net.dv8tion jda-player 0.2.2_22 `
DV8FromTheWorld commented 7 years ago

I believe this was caused by the JVM being in a different language, this the Broken pipe above was printed not as Broken pipe, so it wasn't caught by the English check in the catch.