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 /apps | |
parent | 0466319a753555a65fb2173a5c5a8a3bca2fd96f (diff) | |
download | rockbox-018de3591c17f3e31e7b8203ab12db5bbc9c825e.tar.gz rockbox-018de3591c17f3e31e7b8203ab12db5bbc9c825e.zip |
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
Diffstat (limited to 'apps')
-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 57fca1c00f..912eefef6b 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -222,10 +222,6 @@ static int track_widx = 0; /* Track being buffered (A) */ | |||
222 | static struct track_info *prev_ti = NULL; /* Pointer to the previously played | 222 | static struct track_info *prev_ti = NULL; /* Pointer to the previously played |
223 | track */ | 223 | track */ |
224 | 224 | ||
225 | /* Set by buffering_audio_callback when the low buffer event is received, to | ||
226 | avoid flodding the audio queue with fill_file_buffer messages. */ | ||
227 | static bool lowbuffer_event_sent = false; | ||
228 | |||
229 | /* Set by the audio thread when the current track information has updated | 225 | /* Set by the audio thread when the current track information has updated |
230 | * and the WPS may need to update its cached information */ | 226 | * and the WPS may need to update its cached information */ |
231 | static bool track_changed = false; | 227 | static bool track_changed = false; |
@@ -1500,11 +1496,9 @@ static void buffering_audio_callback(enum callback_event ev, int value) | |||
1500 | switch (ev) | 1496 | switch (ev) |
1501 | { | 1497 | { |
1502 | case EVENT_BUFFER_LOW: | 1498 | case EVENT_BUFFER_LOW: |
1503 | if (!lowbuffer_event_sent) { | 1499 | LOGFQUEUE("buffering > audio Q_AUDIO_FILL_BUFFER"); |
1504 | LOGFQUEUE("buffering > audio Q_AUDIO_FILL_BUFFER"); | 1500 | queue_remove_from_head(&audio_queue, Q_AUDIO_FILL_BUFFER); |
1505 | queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER, 0); | 1501 | queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER, 0); |
1506 | lowbuffer_event_sent = true; | ||
1507 | } | ||
1508 | break; | 1502 | break; |
1509 | 1503 | ||
1510 | case EVENT_HANDLE_REBUFFER: | 1504 | case EVENT_HANDLE_REBUFFER: |
@@ -1972,7 +1966,6 @@ static void audio_fill_file_buffer(bool start_play, size_t offset) | |||
1972 | track_changed = true; | 1966 | track_changed = true; |
1973 | 1967 | ||
1974 | audio_generate_postbuffer_events(); | 1968 | audio_generate_postbuffer_events(); |
1975 | lowbuffer_event_sent = false; | ||
1976 | } | 1969 | } |
1977 | 1970 | ||
1978 | static void audio_rebuffer(void) | 1971 | static void audio_rebuffer(void) |