tsquillario / Jamstash

HTML5 Music Streamer for Subsonic
http://jamstash.com
270 stars 88 forks source link

Jamstash player thinks songs are longer than they are #223

Open khogeland opened 8 years ago

khogeland commented 8 years ago

I've seen this happen a few times on different albums, so I don't think it's a problem with my files. The Subsonic web interface plays everything correctly, and Jamstash does display the times correct in track listing and in the playback queue, but in the player they are sometimes arbitrarily longer:

https://i.imgur.com/6Co2TWv.png

When the player hits the actual time where the songs ends, it will just hang until I manually click next.

Hyzual commented 8 years ago

Hi, thanks for reporting this issue.

I personally haven't experienced this issue so I'm not sure I can reproduce it easily. Do you have transcoding enabled on subsonic ? any special settings ?

I should tell you also that I don't have as much time to work on Jamstash as I used to, so this might take a while to be solved :-/

khogeland commented 8 years ago

I'm transcoding to v0, no special settings to speak of. Are you somehow getting the time differently in the library interface than you are in the player? I don't see how the time could be correct everywhere except the player.

Hyzual commented 8 years ago

Actually yes, in the library interface we display the duration of the song as computed by Subsonic. In the player interface, I suspect the player we use (jPlayer) computes its own duration. Maybe there is a difference in the actual calculation somewhere. I was thinking that this might be due to transcoding... Maybe this is a bug with jPlayer actually, I'll have to check that out

khogeland commented 8 years ago

Looking at the jPlayer API, a possible workaround might be to register a listener on $.jPlayer.event.timeupdate, and load the next track when it hits the actual max duration. That shouldn't break anything when it's working properly, but prevents it from getting stuck when jPlayer gets the wrong duration.

khogeland commented 8 years ago

It appears this is actually a bug that occurs when Subsonic transcodes FLAC or WAV files: http://sourceforge.net/p/subsonic/bugs/121/

But it still couldn't hurt to have a failsafe, since the bug has not yet been patched on their end :~)

Etuldan commented 8 years ago

For FLAC files, maybe you could try this : https://github.com/tsquillario/Jamstash/issues/169#issuecomment-45254726 ?