From 363bc490ff0f8793c5acbc1a38dd5673def7afc2 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 18 Aug 2005 04:38:57 +0000 Subject: Use the provided function to calculate the unsaved space in rec_tick(). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7344 a1c6a512-1295-4272-9138-f99709370657 --- firmware/mpeg.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'firmware') diff --git a/firmware/mpeg.c b/firmware/mpeg.c index c83227267f..a0305760bc 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -546,7 +546,6 @@ void rec_tick (void) __attribute__ ((section (".icode"))); void rec_tick(void) { int i; - int num_bytes; int delay; char data; @@ -616,11 +615,7 @@ void rec_tick(void) { /* Signal to save the data if we are running out of buffer space */ - num_bytes = audiobuf_write - audiobuf_read; - if(num_bytes < 0) - num_bytes += audiobuflen; - - if (audiobuflen - num_bytes < MPEG_RECORDING_LOW_WATER + if (audiobuflen - get_unsaved_space() < MPEG_RECORDING_LOW_WATER && saving_status == NOT_SAVING) { saving_status = BUFFER_FULL; -- cgit v1.2.3