summaryrefslogtreecommitdiff
path: root/firmware/mpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/mpeg.c')
-rw-r--r--firmware/mpeg.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 61b0a22d87..9fe3df224c 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -108,6 +108,9 @@ static struct trackdata trackdata[MAX_TRACK_ENTRIES];
108static unsigned int current_track_counter = 0; 108static unsigned int current_track_counter = 0;
109static unsigned int last_track_counter = 0; 109static unsigned int last_track_counter = 0;
110 110
111/* Play time of the previous track */
112unsigned long prev_track_elapsed;
113
111#ifndef SIMULATOR 114#ifndef SIMULATOR
112static int track_read_idx = 0; 115static int track_read_idx = 0;
113static int track_write_idx = 0; 116static int track_write_idx = 0;
@@ -1056,6 +1059,9 @@ static void track_change(void)
1056{ 1059{
1057 DEBUGF("Track change\n"); 1060 DEBUGF("Track change\n");
1058 1061
1062 struct trackdata *track = get_trackdata(0);
1063 prev_track_elapsed = track->id3.elapsed;
1064
1059#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) 1065#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1060 /* Reset the AVC */ 1066 /* Reset the AVC */
1061 sound_set_avc(-1); 1067 sound_set_avc(-1);
@@ -1072,6 +1078,11 @@ static void track_change(void)
1072 current_track_counter++; 1078 current_track_counter++;
1073} 1079}
1074 1080
1081unsigned long audio_prev_elapsed(void)
1082{
1083 return prev_track_elapsed;
1084}
1085
1075#ifdef DEBUG 1086#ifdef DEBUG
1076void hexdump(const unsigned char *buf, int len) 1087void hexdump(const unsigned char *buf, int len)
1077{ 1088{