diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-09-16 16:18:11 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-09-16 16:18:11 +0000 |
commit | a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f (patch) | |
tree | a30695ed540bf32365d577f46398f712c7a494c4 /firmware/mpeg.c | |
parent | baf5494341cdd6cdb9590e21d429920b9bc4a2c6 (diff) | |
download | rockbox-a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f.tar.gz rockbox-a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f.zip |
New scheduler, with priorities for swcodec platforms. Frequent task
switching should be more efficient and tasks are stored in linked
lists to eliminate unnecessary task switching to improve performance.
Audio should no longer skip on swcodec targets caused by too CPU
hungry UI thread or background threads.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10958 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/mpeg.c')
-rw-r--r-- | firmware/mpeg.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c index df0cbbad12..61b0a22d87 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c | |||
@@ -761,7 +761,6 @@ void rec_tick(void) | |||
761 | { | 761 | { |
762 | prerecord_timeout = current_tick + HZ; | 762 | prerecord_timeout = current_tick + HZ; |
763 | queue_post(&mpeg_queue, MPEG_PRERECORDING_TICK, 0); | 763 | queue_post(&mpeg_queue, MPEG_PRERECORDING_TICK, 0); |
764 | wake_up_thread(); | ||
765 | } | 764 | } |
766 | } | 765 | } |
767 | else | 766 | else |
@@ -773,7 +772,6 @@ void rec_tick(void) | |||
773 | { | 772 | { |
774 | saving_status = BUFFER_FULL; | 773 | saving_status = BUFFER_FULL; |
775 | queue_post(&mpeg_queue, MPEG_SAVE_DATA, 0); | 774 | queue_post(&mpeg_queue, MPEG_SAVE_DATA, 0); |
776 | wake_up_thread(); | ||
777 | } | 775 | } |
778 | } | 776 | } |
779 | } | 777 | } |
@@ -894,8 +892,6 @@ static void transfer_end(unsigned char** ppbuf, int* psize) | |||
894 | *psize = 0; /* no more transfer */ | 892 | *psize = 0; /* no more transfer */ |
895 | } | 893 | } |
896 | } | 894 | } |
897 | |||
898 | wake_up_thread(); | ||
899 | } | 895 | } |
900 | 896 | ||
901 | static struct trackdata *add_track_to_tag_list(const char *filename) | 897 | static struct trackdata *add_track_to_tag_list(const char *filename) |
@@ -2119,8 +2115,7 @@ void audio_init_playback(void) | |||
2119 | queue_post(&mpeg_queue, MPEG_INIT_PLAYBACK, NULL); | 2115 | queue_post(&mpeg_queue, MPEG_INIT_PLAYBACK, NULL); |
2120 | 2116 | ||
2121 | while(!init_playback_done) | 2117 | while(!init_playback_done) |
2122 | sleep_thread(); | 2118 | sleep_thread(1); |
2123 | wake_up_thread(); | ||
2124 | } | 2119 | } |
2125 | 2120 | ||
2126 | 2121 | ||
@@ -2134,8 +2129,7 @@ void audio_init_recording(unsigned int buffer_offset) | |||
2134 | queue_post(&mpeg_queue, MPEG_INIT_RECORDING, NULL); | 2129 | queue_post(&mpeg_queue, MPEG_INIT_RECORDING, NULL); |
2135 | 2130 | ||
2136 | while(!init_recording_done) | 2131 | while(!init_recording_done) |
2137 | sleep_thread(); | 2132 | sleep_thread(1); |
2138 | wake_up_thread(); | ||
2139 | } | 2133 | } |
2140 | 2134 | ||
2141 | static void init_recording(void) | 2135 | static void init_recording(void) |
@@ -2886,10 +2880,10 @@ void audio_init(void) | |||
2886 | 2880 | ||
2887 | #ifndef SIMULATOR | 2881 | #ifndef SIMULATOR |
2888 | audiobuflen = audiobufend - audiobuf; | 2882 | audiobuflen = audiobufend - audiobuf; |
2889 | queue_init(&mpeg_queue); | 2883 | queue_init(&mpeg_queue, true); |
2890 | #endif /* !SIMULATOR */ | 2884 | #endif /* !SIMULATOR */ |
2891 | create_thread(mpeg_thread, mpeg_stack, | 2885 | create_thread(mpeg_thread, mpeg_stack, |
2892 | sizeof(mpeg_stack), mpeg_thread_name); | 2886 | sizeof(mpeg_stack), mpeg_thread_name IF_PRIO(, PRIORITY_SYSTEM)); |
2893 | 2887 | ||
2894 | memset(trackdata, sizeof(trackdata), 0); | 2888 | memset(trackdata, sizeof(trackdata), 0); |
2895 | 2889 | ||