summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-08-29 13:00:35 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-08-29 13:00:35 +0000
commit656625b30e17fe4033d0cf1476b8ee8c044d68a8 (patch)
treeb93aab9a096a111985366baefac5d89a82123126
parente137e9e47f71683ed753c942b53474c55d3f4069 (diff)
downloadrockbox-656625b30e17fe4033d0cf1476b8ee8c044d68a8.tar.gz
rockbox-656625b30e17fe4033d0cf1476b8ee8c044d68a8.zip
Fix logic of test_codec for targets with HAVE_ADJUSTABLE_CPU_FREQ.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30374 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/test_codec.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c
index 5c9820109f..425bb03226 100644
--- a/apps/plugins/test_codec.c
+++ b/apps/plugins/test_codec.c
@@ -20,8 +20,6 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22 22
23
24
25/* All swcodec targets have BUTTON_SELECT apart from the H10 and M3 */ 23/* All swcodec targets have BUTTON_SELECT apart from the H10 and M3 */
26 24
27#if CONFIG_KEYPAD == IRIVER_H10_PAD 25#if CONFIG_KEYPAD == IRIVER_H10_PAD
@@ -52,7 +50,6 @@ static const struct opt_items boost_settings[2] = {
52 { "No", -1 }, 50 { "No", -1 },
53 { "Yes", -1 }, 51 { "Yes", -1 },
54}; 52};
55
56#endif 53#endif
57 54
58/* Log functions copied from test_disk.c */ 55/* Log functions copied from test_disk.c */
@@ -225,7 +222,6 @@ void close_wav(void)
225/* Returns buffer to malloc array. Only codeclib should need this. */ 222/* Returns buffer to malloc array. Only codeclib should need this. */
226static void* codec_get_buffer(size_t *size) 223static void* codec_get_buffer(size_t *size)
227{ 224{
228 DEBUGF("codec_get_buffer(%"PRIuPTR")\n",(uintptr_t)size);
229 *size = CODEC_SIZE; 225 *size = CODEC_SIZE;
230 return codec_mallocbuf; 226 return codec_mallocbuf;
231} 227}
@@ -835,11 +831,11 @@ enum plugin_status plugin_start(const void* parameter)
835 831
836 enum 832 enum
837 { 833 {
838 SPEED_TEST = 0,
839 SPEED_TEST_DIR,
840#ifdef HAVE_ADJUSTABLE_CPU_FREQ 834#ifdef HAVE_ADJUSTABLE_CPU_FREQ
841 BOOST, 835 BOOST = 0,
842#endif 836#endif
837 SPEED_TEST = 1,
838 SPEED_TEST_DIR,
843 WRITE_WAV, 839 WRITE_WAV,
844 SPEED_TEST_WITH_DSP, 840 SPEED_TEST_WITH_DSP,
845 SPEED_TEST_DIR_WITH_DSP, 841 SPEED_TEST_DIR_WITH_DSP,
@@ -851,11 +847,11 @@ enum plugin_status plugin_start(const void* parameter)
851 847
852 MENUITEM_STRINGLIST( 848 MENUITEM_STRINGLIST(
853 menu, "test_codec", NULL, 849 menu, "test_codec", NULL,
854 "Speed test",
855 "Speed test folder",
856#ifdef HAVE_ADJUSTABLE_CPU_FREQ 850#ifdef HAVE_ADJUSTABLE_CPU_FREQ
857 "Boosting", 851 "Boosting",
858#endif 852#endif
853 "Speed test",
854 "Speed test folder",
859 "Write WAV", 855 "Write WAV",
860 "Speed test with DSP", 856 "Speed test with DSP",
861 "Speed test folder with DSP", 857 "Speed test folder with DSP",
@@ -874,8 +870,8 @@ menu:
874#endif 870#endif
875 871
876 result = rb->do_menu(&menu, &selection, NULL, false); 872 result = rb->do_menu(&menu, &selection, NULL, false);
877#ifdef HAVE_ADJUSTABLE_CPU_FREQ
878 873
874#ifdef HAVE_ADJUSTABLE_CPU_FREQ
879 if (result == BOOST) 875 if (result == BOOST)
880 { 876 {
881 rb->set_option("Boosting", &boost, INT, 877 rb->set_option("Boosting", &boost, INT,
@@ -894,17 +890,18 @@ menu:
894 890
895 scandir = 0; 891 scandir = 0;
896 892
897 if ((checksum = (result == CHECKSUM || result == CHECKSUM_DIR))) 893 /* Map test runs with checksum calcualtion to standard runs
898#ifdef HAVE_ADJUSTABLE_CPU_FREQ 894 * SPEED_TEST and SPEED_TEST_DIR and set the 'checksum' flag. */
899 result -= 7; 895 if ((checksum = (result == CHECKSUM ||
900#else 896 result == CHECKSUM_DIR)))
901 result -= 6; 897 result -= 6;
902#endif
903 898
904 if ((use_dsp = ((result >= SPEED_TEST_WITH_DSP) 899 /* Map test runs with DSP to standard runs SPEED_TEST,
905 && (result <= WRITE_WAV_WITH_DSP)))) { 900 * SPEED_TEST_DIR and WRITE_WAV and set the 'use_dsp' flag. */
901 if ((use_dsp = (result >= SPEED_TEST_WITH_DSP &&
902 result <= WRITE_WAV_WITH_DSP)))
906 result -= 3; 903 result -= 3;
907 } 904
908 if (result == SPEED_TEST) { 905 if (result == SPEED_TEST) {
909 wavinfo.fd = -1; 906 wavinfo.fd = -1;
910 log_init(false); 907 log_init(false);