diff options
Diffstat (limited to 'firmware/mpeg.c')
-rw-r--r-- | firmware/mpeg.c | 7 |
1 files changed, 1 insertions, 6 deletions
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"))); | |||
546 | void rec_tick(void) | 546 | void rec_tick(void) |
547 | { | 547 | { |
548 | int i; | 548 | int i; |
549 | int num_bytes; | ||
550 | int delay; | 549 | int delay; |
551 | char data; | 550 | char data; |
552 | 551 | ||
@@ -616,11 +615,7 @@ void rec_tick(void) | |||
616 | { | 615 | { |
617 | /* Signal to save the data if we are running out of buffer | 616 | /* Signal to save the data if we are running out of buffer |
618 | space */ | 617 | space */ |
619 | num_bytes = audiobuf_write - audiobuf_read; | 618 | if (audiobuflen - get_unsaved_space() < MPEG_RECORDING_LOW_WATER |
620 | if(num_bytes < 0) | ||
621 | num_bytes += audiobuflen; | ||
622 | |||
623 | if (audiobuflen - num_bytes < MPEG_RECORDING_LOW_WATER | ||
624 | && saving_status == NOT_SAVING) | 619 | && saving_status == NOT_SAVING) |
625 | { | 620 | { |
626 | saving_status = BUFFER_FULL; | 621 | saving_status = BUFFER_FULL; |