rubbersoul wrote:daneren2005 wrote:Well that's good. I'm not sure what I can do to stop that first pause, but at the very least it shouldn't be restarting from the beginning and I'm hoping that now the random stutterings people were experiencing after the file is already buffered will be gone. Anyone else able to test the newest beta who were previously having issues?
just curious, do you know what is going on here? i've experienced this short stutter after 20s or so on the first track on subsonic for as long as i can remember.
Ok, time for some technical explanation. For the media playback I have a onComplete function that is supposed to happen when the file is done playing. If you have slow downloading then the end of the file might be reached in the middle of playing, so it pauses playback until it can continue again, and restarts from the position you were at.
There are three main problems:
1) Some players don't seem to remember where they were at when they reach this function, so it restarts from the beginning. I think I've solved this by keeping track of the position as playback is going on.
2) Before it was doing long extensive IO operations when files were done downloading, which was causing brief stuttering while they happened. I think I solved this.
3) Some players seem to call the complete function even after the entire file is done downloading, but long before that song is over. What I'm thinking is happening is the player is trying to buffer ahead of time, and reaches the end of the file while still downloading, then stops trying to buffer. Then when the player reaches that point it stopped buffering, it stops thinking it was done. From the googling I did I'm thinking this is worse because in JB google apparently increased the amount of buffer ahead by quite a bit. I'm still not exactly sure what I can do about this though. I'm hoping though that as long as it only does it for the first song, and only once, and doesn't just reset back to the beginning, it should be acceptable to most people.