I'm using libspotify SDK
, C library for win32.
I think to have a right setup, every session callback is registered. I don't understand why i can't receive the call for end_of_track
, while music_delivery
continues to be called with zero padding 22050
long frames.
I attempt to start playing first loading the track with sp_session_load
; till it returns SP_ERROR_IS_LOADING
I post a message on my message queue (synchronization method I've used, PostMessage
win32 API) in order to reload again with same API sp_session_load
. As soon as it returns SP_ERROR_OK
I use the sp_session_play
and the music_delivery
starts immediately, with correct frames.
I don't know why at the end of track the libspotify
runtime then start sending zero padded frames, instead of calling end_of_track
callback.
In other conditions it works perfectly: I've used the sp_track
obtained from a album browse, so the track is fully loaded at the moment I load to the current session for playing: with this track, it works fine with end_of_track
called correctly. In the case with padding error, I search the track using its Spotify URI and got the results; in this case the track metadata are not still ready (at the play attempt) so I used that kind of "polling" on sp_session_load
with PostMessage
.
Can anybody help me?