diff options
-rw-r--r-- | apps/plugin.c | 2 | ||||
-rw-r--r-- | apps/plugin.h | 2 | ||||
-rw-r--r-- | apps/plugins/lib/configfile.c | 75 | ||||
-rw-r--r-- | apps/plugins/mpegplayer/mpegplayer.c | 8 | ||||
-rw-r--r-- | firmware/drivers/button.c | 2 | ||||
-rw-r--r-- | firmware/export/button.h | 2 | ||||
-rw-r--r-- | uisimulator/sdl/button.c | 2 |
7 files changed, 47 insertions, 46 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 7981c36b92..02842572f5 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -518,7 +518,7 @@ static const struct plugin_api rockbox_api = { | |||
518 | talk_disable_menus, | 518 | talk_disable_menus, |
519 | talk_enable_menus, | 519 | talk_enable_menus, |
520 | 520 | ||
521 | button_available, | 521 | button_queue_count, |
522 | 522 | ||
523 | }; | 523 | }; |
524 | 524 | ||
diff --git a/apps/plugin.h b/apps/plugin.h index 7277d8031c..eeeb11e387 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -636,7 +636,7 @@ struct plugin_api { | |||
636 | void (*talk_disable_menus)(void); | 636 | void (*talk_disable_menus)(void); |
637 | void (*talk_enable_menus)(void); | 637 | void (*talk_enable_menus)(void); |
638 | 638 | ||
639 | int (*button_available)(void); | 639 | int (*button_queue_count)(void); |
640 | }; | 640 | }; |
641 | 641 | ||
642 | /* plugin header */ | 642 | /* plugin header */ |
diff --git a/apps/plugins/lib/configfile.c b/apps/plugins/lib/configfile.c index 476f776878..7c7d56e4e5 100644 --- a/apps/plugins/lib/configfile.c +++ b/apps/plugins/lib/configfile.c | |||
@@ -154,7 +154,7 @@ int configfile_get_value(const char* filename, const char* name) | |||
154 | get_cfg_filename(buf, MAX_PATH, filename); | 154 | get_cfg_filename(buf, MAX_PATH, filename); |
155 | fd = cfg_rb->open(buf, O_RDONLY); | 155 | fd = cfg_rb->open(buf, O_RDONLY); |
156 | if(fd < 0) | 156 | if(fd < 0) |
157 | return -1; | 157 | return -1; |
158 | 158 | ||
159 | while(cfg_rb->read_line(fd, buf, MAX_PATH) > 0) | 159 | while(cfg_rb->read_line(fd, buf, MAX_PATH) > 0) |
160 | { | 160 | { |
@@ -172,43 +172,42 @@ int configfile_get_value(const char* filename, const char* name) | |||
172 | 172 | ||
173 | int configfile_update_entry(const char* filename, const char* name, int val) | 173 | int configfile_update_entry(const char* filename, const char* name, int val) |
174 | { | 174 | { |
175 | int fd; | 175 | int fd; |
176 | char *pname; | 176 | char *pname; |
177 | char *pval; | 177 | char *pval; |
178 | char path[MAX_PATH]; | 178 | char path[MAX_PATH]; |
179 | char buf[256]; | 179 | char buf[256]; |
180 | int found = 0; | 180 | int found = 0; |
181 | int line_len = 0; | 181 | int line_len = 0; |
182 | int pos = 0; | 182 | int pos = 0; |
183 | 183 | ||
184 | /* open the current config file */ | 184 | /* open the current config file */ |
185 | get_cfg_filename(path, MAX_PATH, filename); | 185 | get_cfg_filename(path, MAX_PATH, filename); |
186 | fd = cfg_rb->open(path, O_RDWR); | 186 | fd = cfg_rb->open(path, O_RDWR); |
187 | if(fd < 0) | 187 | if(fd < 0) |
188 | return -1; | 188 | return -1; |
189 | 189 | ||
190 | /* read in the current stored settings */ | 190 | /* read in the current stored settings */ |
191 | while((line_len = cfg_rb->read_line(fd, buf, 256)) > 0) | 191 | while((line_len = cfg_rb->read_line(fd, buf, 256)) > 0) |
192 | { | ||
193 | cfg_rb->settings_parseline(buf, &pname, &pval); | ||
194 | |||
195 | if(!cfg_rb->strcmp(name, pname)) | ||
196 | { | 192 | { |
197 | found = 1; | 193 | cfg_rb->settings_parseline(buf, &pname, &pval); |
198 | cfg_rb->lseek(fd, pos, SEEK_SET); | 194 | if(!cfg_rb->strcmp(name, pname)) |
199 | /* pre-allocate 10 bytes for INT */ | 195 | { |
200 | cfg_rb->fdprintf(fd, "%s: %10d\n", pname, val); | 196 | found = 1; |
201 | break; | 197 | cfg_rb->lseek(fd, pos, SEEK_SET); |
198 | /* pre-allocate 10 bytes for INT */ | ||
199 | cfg_rb->fdprintf(fd, "%s: %10d\n", pname, val); | ||
200 | break; | ||
201 | } | ||
202 | pos += line_len; | ||
202 | } | 203 | } |
203 | pos += line_len; | 204 | |
204 | } | 205 | /* if (name/val) is a new entry just append to file */ |
205 | 206 | if (found == 0) | |
206 | /* if (name/val) is a new entry just append to file */ | 207 | /* pre-allocate 10 bytes for INT */ |
207 | if (found == 0) | 208 | cfg_rb->fdprintf(fd, "%s: %10d\n", name, val); |
208 | /* pre-allocate 10 bytes for INT */ | 209 | |
209 | cfg_rb->fdprintf(fd, "%s: %10d\n", name, val); | 210 | cfg_rb->close(fd); |
210 | 211 | ||
211 | cfg_rb->close(fd); | 212 | return found; |
212 | |||
213 | return found; | ||
214 | } | 213 | } |
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 128eb268a6..b5e11980db 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c | |||
@@ -110,7 +110,6 @@ FPS | 27Mhz | 100Hz | 44.1KHz | 48KHz | |||
110 | #include "mpeg_settings.h" | 110 | #include "mpeg_settings.h" |
111 | #include "video_out.h" | 111 | #include "video_out.h" |
112 | #include "../../codecs/libmad/mad.h" | 112 | #include "../../codecs/libmad/mad.h" |
113 | #include "splash.h" | ||
114 | 113 | ||
115 | PLUGIN_HEADER | 114 | PLUGIN_HEADER |
116 | PLUGIN_IRAM_DECLARE | 115 | PLUGIN_IRAM_DECLARE |
@@ -649,10 +648,12 @@ static int get_next_data( Stream* str, uint8_t type ) | |||
649 | rb->splash( HZ*3, "missing packet start code prefix : %X%X at %lX", | 648 | rb->splash( HZ*3, "missing packet start code prefix : %X%X at %lX", |
650 | *p, *(p+2), (long unsigned int)(p-disk_buf_start) ); | 649 | *p, *(p+2), (long unsigned int)(p-disk_buf_start) ); |
651 | 650 | ||
651 | /* not 64bit safe | ||
652 | DEBUGF("end diff: %X,%X,%X,%X,%X,%X\n",(int)str->curr_packet_end, | 652 | DEBUGF("end diff: %X,%X,%X,%X,%X,%X\n",(int)str->curr_packet_end, |
653 | (int)audio_str.curr_packet_end,(int)video_str.curr_packet_end, | 653 | (int)audio_str.curr_packet_end,(int)video_str.curr_packet_end, |
654 | (int)disk_buf_start,(int)disk_buf_end,(int)disk_buf_tail); | 654 | (int)disk_buf_start,(int)disk_buf_end,(int)disk_buf_tail); |
655 | 655 | */ | |
656 | |||
656 | str->curr_packet_end = str->curr_packet = NULL; | 657 | str->curr_packet_end = str->curr_packet = NULL; |
657 | break; | 658 | break; |
658 | } | 659 | } |
@@ -2035,7 +2036,7 @@ ssize_t seek_PTS( int in_file, int start_time, int accept_button ) | |||
2035 | if ( accept_button ) | 2036 | if ( accept_button ) |
2036 | { | 2037 | { |
2037 | rb->yield(); | 2038 | rb->yield(); |
2038 | if (rb->button_available()) | 2039 | if (rb->button_queue_count()) |
2039 | return -101; | 2040 | return -101; |
2040 | } | 2041 | } |
2041 | 2042 | ||
@@ -2159,6 +2160,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | |||
2159 | if (parameter == NULL) | 2160 | if (parameter == NULL) |
2160 | { | 2161 | { |
2161 | api->splash(HZ*2, "No File"); | 2162 | api->splash(HZ*2, "No File"); |
2163 | return PLUGIN_ERROR; | ||
2162 | } | 2164 | } |
2163 | 2165 | ||
2164 | /* Initialize IRAM - stops audio and voice as well */ | 2166 | /* Initialize IRAM - stops audio and voice as well */ |
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index d79a9333ff..851b5b9b20 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -293,7 +293,7 @@ static void button_boost(bool state) | |||
293 | } | 293 | } |
294 | #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ | 294 | #endif /* HAVE_ADJUSTABLE_CPU_FREQ */ |
295 | 295 | ||
296 | int button_available( void ) | 296 | int button_queue_count( void ) |
297 | { | 297 | { |
298 | return queue_count(&button_queue); | 298 | return queue_count(&button_queue); |
299 | } | 299 | } |
diff --git a/firmware/export/button.h b/firmware/export/button.h index 881d7c424d..a38385c4cf 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h | |||
@@ -27,7 +27,7 @@ | |||
27 | extern struct event_queue button_queue; | 27 | extern struct event_queue button_queue; |
28 | 28 | ||
29 | void button_init (void); | 29 | void button_init (void); |
30 | int button_available(void); | 30 | int button_queue_count(void); |
31 | long button_get (bool block); | 31 | long button_get (bool block); |
32 | long button_get_w_tmo(int ticks); | 32 | long button_get_w_tmo(int ticks); |
33 | intptr_t button_get_data(void); | 33 | intptr_t button_get_data(void); |
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 2b44a7bace..a15faf72c0 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c | |||
@@ -736,7 +736,7 @@ void button_event(int key, bool pressed) | |||
736 | 736 | ||
737 | /* Again copied from real button.c... */ | 737 | /* Again copied from real button.c... */ |
738 | 738 | ||
739 | int button_available( void ) | 739 | int button_queue_count( void ) |
740 | { | 740 | { |
741 | return queue_count(&button_queue); | 741 | return queue_count(&button_queue); |
742 | } | 742 | } |