diff options
-rw-r--r-- | firmware/mpeg.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 7151baafaa..b8c922c3be 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c | |||
@@ -24,13 +24,13 @@ | |||
24 | #include "mpeg.h" | 24 | #include "mpeg.h" |
25 | #include "ata.h" | 25 | #include "ata.h" |
26 | #include "string.h" | 26 | #include "string.h" |
27 | #include "kernel.h" | ||
28 | #include "thread.h" | ||
27 | #ifndef SIMULATOR | 29 | #ifndef SIMULATOR |
28 | #include "i2c.h" | 30 | #include "i2c.h" |
29 | #include "mas.h" | 31 | #include "mas.h" |
30 | #include "dac.h" | 32 | #include "dac.h" |
31 | #include "system.h" | 33 | #include "system.h" |
32 | #include "kernel.h" | ||
33 | #include "thread.h" | ||
34 | #include "usb.h" | 34 | #include "usb.h" |
35 | #include "file.h" | 35 | #include "file.h" |
36 | #include "hwcompat.h" | 36 | #include "hwcompat.h" |
@@ -2785,10 +2785,30 @@ void mpeg_set_recording_gain(int left, int right, int mic) | |||
2785 | } | 2785 | } |
2786 | #endif | 2786 | #endif |
2787 | 2787 | ||
2788 | #ifdef SIMULATOR | ||
2789 | static char mpeg_stack[DEFAULT_STACK_SIZE]; | ||
2790 | static char mpeg_thread_name[] = "mpeg"; | ||
2791 | static void mpeg_thread(void) | ||
2792 | { | ||
2793 | struct mp3entry* id3; | ||
2794 | while ( 1 ) { | ||
2795 | if (is_playing) { | ||
2796 | id3 = mpeg_current_track(); | ||
2797 | id3->elapsed+=1000; | ||
2798 | if (id3->elapsed>=id3->length) | ||
2799 | mpeg_next(); | ||
2800 | } | ||
2801 | sleep(1); | ||
2802 | } | ||
2803 | } | ||
2804 | #endif | ||
2805 | |||
2788 | void mpeg_init(int volume, int bass, int treble, int balance, int loudness, int bass_boost, int avc) | 2806 | void mpeg_init(int volume, int bass, int treble, int balance, int loudness, int bass_boost, int avc) |
2789 | { | 2807 | { |
2790 | #ifdef SIMULATOR | 2808 | #ifdef SIMULATOR |
2791 | volume = bass = treble = balance = loudness = bass_boost = avc; | 2809 | volume = bass = treble = balance = loudness = bass_boost = avc; |
2810 | create_thread(mpeg_thread, mpeg_stack, | ||
2811 | sizeof(mpeg_stack), mpeg_thread_name); | ||
2792 | #else | 2812 | #else |
2793 | #ifdef HAVE_MAS3507D | 2813 | #ifdef HAVE_MAS3507D |
2794 | unsigned long val; | 2814 | unsigned long val; |