forked from len0rd/rockbox
Safer low water mark when recording
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3557 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
631b8d3bb8
commit
1cc6d829a1
2 changed files with 4 additions and 2 deletions
|
|
@ -26,6 +26,7 @@
|
||||||
wouldn't be able to see the difference between
|
wouldn't be able to see the difference between
|
||||||
an empty buffer and a full one. */
|
an empty buffer and a full one. */
|
||||||
#define MPEG_LOW_WATER 0x60000
|
#define MPEG_LOW_WATER 0x60000
|
||||||
|
#define MPEG_RECORDING_LOW_WATER 0x80000
|
||||||
#define MPEG_LOW_WATER_CHUNKSIZE 0x40000
|
#define MPEG_LOW_WATER_CHUNKSIZE 0x40000
|
||||||
#define MPEG_LOW_WATER_SWAP_CHUNKSIZE 0x10000
|
#define MPEG_LOW_WATER_SWAP_CHUNKSIZE 0x10000
|
||||||
#define MPEG_PLAY_PENDING_THRESHOLD 0x10000
|
#define MPEG_PLAY_PENDING_THRESHOLD 0x10000
|
||||||
|
|
|
||||||
|
|
@ -854,7 +854,7 @@ static void dma_tick(void)
|
||||||
if(num_bytes < 0)
|
if(num_bytes < 0)
|
||||||
num_bytes += mp3buflen;
|
num_bytes += mp3buflen;
|
||||||
|
|
||||||
if(mp3buflen - num_bytes < MPEG_LOW_WATER && !saving)
|
if(mp3buflen - num_bytes < MPEG_RECORDING_LOW_WATER && !saving)
|
||||||
{
|
{
|
||||||
saving = true;
|
saving = true;
|
||||||
queue_post(&mpeg_queue, MPEG_SAVE_DATA, 0);
|
queue_post(&mpeg_queue, MPEG_SAVE_DATA, 0);
|
||||||
|
|
@ -1940,7 +1940,8 @@ static void mpeg_thread(void)
|
||||||
or if we should stop recording */
|
or if we should stop recording */
|
||||||
if(amount_to_save)
|
if(amount_to_save)
|
||||||
{
|
{
|
||||||
if(mp3buflen - amount_to_save < MPEG_LOW_WATER ||
|
if(mp3buflen -
|
||||||
|
amount_to_save < MPEG_RECORDING_LOW_WATER ||
|
||||||
stop_pending)
|
stop_pending)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue