diff options
| author | Steve Bavin <pondlife@pondlife.me> | 2008-03-03 12:01:29 +0000 |
|---|---|---|
| committer | Steve Bavin <pondlife@pondlife.me> | 2008-03-03 12:01:29 +0000 |
| commit | 018de3591c17f3e31e7b8203ab12db5bbc9c825e (patch) | |
| tree | 88fbb98a591adc9b85bef9248cff763e0ad37685 | |
| parent | 0466319a753555a65fb2173a5c5a8a3bca2fd96f (diff) | |
| download | rockbox-018de3591c17f3e31e7b8203ab12db5bbc9c825e.zip rockbox-018de3591c17f3e31e7b8203ab12db5bbc9c825e.tar.gz rockbox-018de3591c17f3e31e7b8203ab12db5bbc9c825e.tar.bz2 rockbox-018de3591c17f3e31e7b8203ab12db5bbc9c825e.tar.xz | |
Slightly simpler mechanism to avoid Q_AUDIO_FILL_BUFFER floods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16497 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/playback.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/apps/playback.c b/apps/playback.c index 57fca1c..912eefe 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -222,10 +222,6 @@ static int track_widx = 0; /* Track being buffered (A) */ static struct track_info *prev_ti = NULL; /* Pointer to the previously played track */ -/* Set by buffering_audio_callback when the low buffer event is received, to - avoid flodding the audio queue with fill_file_buffer messages. */ -static bool lowbuffer_event_sent = false; - /* Set by the audio thread when the current track information has updated * and the WPS may need to update its cached information */ static bool track_changed = false; @@ -1500,11 +1496,9 @@ static void buffering_audio_callback(enum callback_event ev, int value) switch (ev) { case EVENT_BUFFER_LOW: - if (!lowbuffer_event_sent) { - LOGFQUEUE("buffering > audio Q_AUDIO_FILL_BUFFER"); - queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER, 0); - lowbuffer_event_sent = true; - } + LOGFQUEUE("buffering > audio Q_AUDIO_FILL_BUFFER"); + queue_remove_from_head(&audio_queue, Q_AUDIO_FILL_BUFFER); + queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER, 0); break; case EVENT_HANDLE_REBUFFER: @@ -1972,7 +1966,6 @@ static void audio_fill_file_buffer(bool start_play, size_t offset) track_changed = true; audio_generate_postbuffer_events(); - lowbuffer_event_sent = false; } static void audio_rebuffer(void) |