summaryrefslogtreecommitdiff
path: root/firmware/mpeg.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-09-16 16:18:11 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-09-16 16:18:11 +0000
commita85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f (patch)
treea30695ed540bf32365d577f46398f712c7a494c4 /firmware/mpeg.c
parentbaf5494341cdd6cdb9590e21d429920b9bc4a2c6 (diff)
downloadrockbox-a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f.zip
rockbox-a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f.tar.gz
rockbox-a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f.tar.bz2
rockbox-a85044bf9eaa0a7206c1978d3cfd57ab2d7fae2f.tar.xz
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.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index df0cbba..61b0a22 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -761,7 +761,6 @@ void rec_tick(void)
{
prerecord_timeout = current_tick + HZ;
queue_post(&mpeg_queue, MPEG_PRERECORDING_TICK, 0);
- wake_up_thread();
}
}
else
@@ -773,7 +772,6 @@ void rec_tick(void)
{
saving_status = BUFFER_FULL;
queue_post(&mpeg_queue, MPEG_SAVE_DATA, 0);
- wake_up_thread();
}
}
}
@@ -894,8 +892,6 @@ static void transfer_end(unsigned char** ppbuf, int* psize)
*psize = 0; /* no more transfer */
}
}
-
- wake_up_thread();
}
static struct trackdata *add_track_to_tag_list(const char *filename)
@@ -2119,8 +2115,7 @@ void audio_init_playback(void)
queue_post(&mpeg_queue, MPEG_INIT_PLAYBACK, NULL);
while(!init_playback_done)
- sleep_thread();
- wake_up_thread();
+ sleep_thread(1);
}
@@ -2134,8 +2129,7 @@ void audio_init_recording(unsigned int buffer_offset)
queue_post(&mpeg_queue, MPEG_INIT_RECORDING, NULL);
while(!init_recording_done)
- sleep_thread();
- wake_up_thread();
+ sleep_thread(1);
}
static void init_recording(void)
@@ -2886,10 +2880,10 @@ void audio_init(void)
#ifndef SIMULATOR
audiobuflen = audiobufend - audiobuf;
- queue_init(&mpeg_queue);
+ queue_init(&mpeg_queue, true);
#endif /* !SIMULATOR */
create_thread(mpeg_thread, mpeg_stack,
- sizeof(mpeg_stack), mpeg_thread_name);
+ sizeof(mpeg_stack), mpeg_thread_name IF_PRIO(, PRIORITY_SYSTEM));
memset(trackdata, sizeof(trackdata), 0);