diff options
author | William Wilgus <wilgus.william@gmail.com> | 2021-03-04 23:31:32 -0500 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2021-03-04 23:31:32 -0500 |
commit | 895ed92496408b538f2dc58a07d4e5ad56d24560 (patch) | |
tree | 86603a2ffac88e80cb37f4c3d2f0e270c9450260 | |
parent | 03ae4e6019500c1fb9a292ae428e5c47b17bf18f (diff) | |
download | rockbox-895ed92496408b538f2dc58a07d4e5ad56d24560.tar.gz rockbox-895ed92496408b538f2dc58a07d4e5ad56d24560.zip |
Talk.c, playlist.c fix bugs
fix bug in talk.c
playlist.c only dump voice buffer if we are out of space
Change-Id: I75705d755db4193a87e542d062dbdc96b153dbb6
-rw-r--r-- | apps/playlist.c | 3 | ||||
-rw-r--r-- | apps/talk.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index af733f486c..6f26b6beda 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -2122,7 +2122,8 @@ int playlist_resume(void) | |||
2122 | * default buflib buffers can be moved around which must be avoided */ | 2122 | * default buflib buffers can be moved around which must be avoided */ |
2123 | static struct buflib_callbacks dummy_ops; | 2123 | static struct buflib_callbacks dummy_ops; |
2124 | /* use mp3 buffer for maximum load speed */ | 2124 | /* use mp3 buffer for maximum load speed */ |
2125 | talk_buffer_set_policy(TALK_BUFFER_LOOSE); /* back off voice buffer */ | 2125 | if (core_allocatable() < (1 << 10)) |
2126 | talk_buffer_set_policy(TALK_BUFFER_LOOSE); /* back off voice buffer */ | ||
2126 | handle = core_alloc_maximum("temp", &buflen, &dummy_ops); | 2127 | handle = core_alloc_maximum("temp", &buflen, &dummy_ops); |
2127 | if (handle < 0) | 2128 | if (handle < 0) |
2128 | panicf("%s(): OOM", __func__); | 2129 | panicf("%s(): OOM", __func__); |
diff --git a/apps/talk.c b/apps/talk.c index 8a428d1ed8..551d9672bc 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -625,8 +625,10 @@ static bool load_voicefile_data(int fd) | |||
625 | metadata_alloc_size = max_clips * sizeof(struct clip_cache_metadata); | 625 | metadata_alloc_size = max_clips * sizeof(struct clip_cache_metadata); |
626 | metadata_table_handle = buflib_alloc(&clip_ctx, metadata_alloc_size); | 626 | metadata_table_handle = buflib_alloc(&clip_ctx, metadata_alloc_size); |
627 | if (metadata_table_handle <= 0) | 627 | if (metadata_table_handle <= 0) |
628 | { | ||
628 | talk_status = TALK_STATUS_ERR_OOM; | 629 | talk_status = TALK_STATUS_ERR_OOM; |
629 | return false; | 630 | return false; |
631 | } | ||
630 | memset(buflib_get_data(&clip_ctx, metadata_table_handle), 0, metadata_alloc_size); | 632 | memset(buflib_get_data(&clip_ctx, metadata_table_handle), 0, metadata_alloc_size); |
631 | 633 | ||
632 | load_initial_clips(fd); | 634 | load_initial_clips(fd); |