Permalink
Browse files

fix for not loaded tracks

  • Loading branch information...
1 parent 174a934 commit 75454801ed053f9a8d075c5c40325b9665a72ad0 @vilhelmk committed Oct 25, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 trackiterator.c
View
@@ -100,6 +100,7 @@ PHP_METHOD(SpotifyTrackIterator, __destruct)
static void get_track_by_index(spotifytrackiterator_object *p, zval *thisptr, int index, zval **return_value) {
zval temp, *spotifyobject;
sp_track *track;
+ int timeout;
switch (p->type) {
case TYPE_ALBUM:
@@ -110,6 +111,10 @@ static void get_track_by_index(spotifytrackiterator_object *p, zval *thisptr, in
break;
}
+ while (!sp_track_is_loaded(track)) {
+ sp_session_process_events(p->session, &timeout);
+ }
+
spotifyobject = GET_PROPERTY(spotifytrackiterator_ce, thisptr, "spotify");
object_init_ex(*return_value, spotifytrack_ce);

0 comments on commit 7545480

Please sign in to comment.