summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-10-27 15:35:51 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-10-27 15:35:51 +0000
commit41add08c5edb9d3de7e223e860cef035b41a3b01 (patch)
tree8b41c24f35ac9f37c0efd8f11264ca2fc23e3a61
parentd0c44f52d75ea6d2806d65bb77e8670ccefe6062 (diff)
downloadrockbox-41add08c5edb9d3de7e223e860cef035b41a3b01.tar.gz
rockbox-41add08c5edb9d3de7e223e860cef035b41a3b01.zip
Prevent the audio queue from getting flooded with fill buffer messages.
The low buffer callback is registred by instead of the function it calls to prevent a loop. audio_check_new_track() also makes more sense because that's where tracks are made useless by a skip. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15335 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playback.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 2425cf5376..2ac54e7d74 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -2594,8 +2594,6 @@ static void audio_fill_file_buffer(bool start_play, size_t offset)
2594 if (!queue_empty(&audio_queue)) { 2594 if (!queue_empty(&audio_queue)) {
2595 /* There's a message in the queue. break the loop to treat it, 2595 /* There's a message in the queue. break the loop to treat it,
2596 and go back to filling after that. */ 2596 and go back to filling after that. */
2597 LOGFQUEUE("buffering > audio Q_AUDIO_FILL_BUFFER");
2598 queue_post(&audio_queue, Q_AUDIO_FILL_BUFFER, 0);
2599 break; 2597 break;
2600 } 2598 }
2601 } while (continue_buffering); 2599 } while (continue_buffering);
@@ -2604,7 +2602,6 @@ static void audio_fill_file_buffer(bool start_play, size_t offset)
2604 track_changed = true; 2602 track_changed = true;
2605 2603
2606 audio_generate_postbuffer_events(); 2604 audio_generate_postbuffer_events();
2607 register_buffer_low_callback(low_buffer_callback);
2608} 2605}
2609 2606
2610static void audio_rebuffer(void) 2607static void audio_rebuffer(void)
@@ -2702,6 +2699,7 @@ static int audio_check_new_track(void)
2702 track_ridx &= MAX_TRACK_MASK; 2699 track_ridx &= MAX_TRACK_MASK;
2703 2700
2704 buf_set_base_handle(CUR_TI->audio_hid); 2701 buf_set_base_handle(CUR_TI->audio_hid);
2702 register_buffer_low_callback(low_buffer_callback);
2705 2703
2706 if (automatic_skip) 2704 if (automatic_skip)
2707 { 2705 {