summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 3fa42b9f94..7b614cd0d0 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1562,11 +1562,12 @@ static void buffering_handle_rebuffer_callback(void *data)
1562 queue_post(&audio_queue, Q_AUDIO_FLUSH, 0); 1562 queue_post(&audio_queue, Q_AUDIO_FLUSH, 0);
1563} 1563}
1564 1564
1565static void buffering_handle_finished_callback(int *data) 1565static void buffering_handle_finished_callback(void *data)
1566{ 1566{
1567 logf("handle %d finished buffering", *data); 1567 logf("handle %d finished buffering", *data);
1568 int hid = (*(int*)data);
1568 1569
1569 if (*data == tracks[track_widx].id3_hid) 1570 if (hid == tracks[track_widx].id3_hid)
1570 { 1571 {
1571 int offset = ci.new_track + wps_offset; 1572 int offset = ci.new_track + wps_offset;
1572 int next_idx = (track_ridx + offset + 1) & MAX_TRACK_MASK; 1573 int next_idx = (track_ridx + offset + 1) & MAX_TRACK_MASK;
@@ -1574,16 +1575,16 @@ static void buffering_handle_finished_callback(int *data)
1574 We can ask the audio thread to load the rest of the track's data. */ 1575 We can ask the audio thread to load the rest of the track's data. */
1575 LOGFQUEUE("audio >| audio Q_AUDIO_FINISH_LOAD"); 1576 LOGFQUEUE("audio >| audio Q_AUDIO_FINISH_LOAD");
1576 queue_post(&audio_queue, Q_AUDIO_FINISH_LOAD, 0); 1577 queue_post(&audio_queue, Q_AUDIO_FINISH_LOAD, 0);
1577 if (tracks[next_idx].id3_hid == *data) 1578 if (tracks[next_idx].id3_hid == hid)
1578 send_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, NULL); 1579 send_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, NULL);
1579 } 1580 }
1580 else 1581 else
1581 { 1582 {
1582 /* This is most likely an audio handle, so we strip the useless 1583 /* This is most likely an audio handle, so we strip the useless
1583 trailing tags that are left. */ 1584 trailing tags that are left. */
1584 strip_tags(*data); 1585 strip_tags(hid);
1585 1586
1586 if (*data == tracks[track_widx-1].audio_hid 1587 if (hid == tracks[track_widx-1].audio_hid
1587 && filling == STATE_END_OF_PLAYLIST) 1588 && filling == STATE_END_OF_PLAYLIST)
1588 { 1589 {
1589 /* This was the last track in the playlist. 1590 /* This was the last track in the playlist.