summaryrefslogtreecommitdiff
path: root/apps/mpeg.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-04-06 00:39:43 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-04-06 00:39:43 +0000
commit843c7efaf8c953fc3bec40a7da0be3a5da9950df (patch)
treecb27e411394f716d26193433c66132072730ea70 /apps/mpeg.c
parent9188f0ffd7ce97101a5b2d697cc43072cd63b502 (diff)
downloadrockbox-843c7efaf8c953fc3bec40a7da0be3a5da9950df.tar.gz
rockbox-843c7efaf8c953fc3bec40a7da0be3a5da9950df.zip
FS9795 - some playback cleanup.
* Use events to notify things when the track has changed instead of the nasty has_track_changed() * Event for when the mp3entry for the next track is avilable (which allows alot more tags to be static which means less redrawing in the WPS) * virtually guarentee that the mp3entry sturct returned by audio_current/next_track() is going to be valid for the duration of the current track. The only time it wont be now is during the time between the codec finishing the previous track and the next track actually starting (~2s), but this is not an issue as long as it is called again when the TRACK_CHANGED event happens (or just use the pointer that gives) It is still possible to confuse the WPS with the next tracks id3 info being displayed but this should fix itself up faster than it used to (and be harder to do) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20633 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/mpeg.c')
-rw-r--r--apps/mpeg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/mpeg.c b/apps/mpeg.c
index cde72ab54f..5ebf58fcf0 100644
--- a/apps/mpeg.c
+++ b/apps/mpeg.c
@@ -852,6 +852,7 @@ static void transfer_end(unsigned char** ppbuf, size_t* psize)
852static struct trackdata *add_track_to_tag_list(const char *filename) 852static struct trackdata *add_track_to_tag_list(const char *filename)
853{ 853{
854 struct trackdata *track; 854 struct trackdata *track;
855 bool send_nid3_event;
855 856
856 if(num_tracks_in_memory() >= MAX_TRACK_ENTRIES) 857 if(num_tracks_in_memory() >= MAX_TRACK_ENTRIES)
857 { 858 {
@@ -882,7 +883,11 @@ static struct trackdata *add_track_to_tag_list(const char *filename)
882 if (cuesheet_callback(filename)) 883 if (cuesheet_callback(filename))
883 track->id3.cuesheet_type = 1; 884 track->id3.cuesheet_type = 1;
884 885
886 /* if this track is the next track then let the UI know it can get it */
887 send_nid3_event = (track_write_idx == track_read_idx + 1);
885 track_write_idx = (track_write_idx+1) & MAX_TRACK_ENTRIES_MASK; 888 track_write_idx = (track_write_idx+1) & MAX_TRACK_ENTRIES_MASK;
889 if (send_nid3_event)
890 send_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, NULL);
886 debug_tags(); 891 debug_tags();
887 return track; 892 return track;
888} 893}