diff options
author | William Wilgus <wilgus.william@gmail.com> | 2024-12-07 23:56:52 -0500 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2024-12-07 23:56:52 -0500 |
commit | 9eb9e4ab22967ac72f98cb5bd67d0fc7e6059444 (patch) | |
tree | ef6afb9f5a196bd95a9af7e3198d241b1fef9d69 | |
parent | bcc8c608e5cc321eec35b916bad2b338de6e0197 (diff) | |
download | rockbox-9eb9e4ab22.tar.gz rockbox-9eb9e4ab22.zip |
[Bugfix/Red] fix red in checkwps , fix mp3_encoder plugin div by 0, warnings
checkwps doesn't have current_tick
mp3_encoder had a divide by zero if the file wasn't encoded correctly or wrong file was passed
fix gcc warning in huffman encoder
move text for small screens
Change-Id: I9d09353e184e760ae31d1a1cd434d2790eacb7ca
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 4 | ||||
-rw-r--r-- | apps/plugins/mp3_encoder.c | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 337d8ed118..dbd39edebc 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -953,7 +953,11 @@ static int parse_timeout_tag(struct skin_element *element, { st->show = val; st->hide = get_param(element, 1)->data.number; +#ifndef __PCTOOL__ st->next_tick = current_tick; /* show immediately the first time */ +#else + st->next_tick = 0; /* checkwps doesn't have current_tick */ +#endif token->type = SKIN_TOKEN_SUBLINE_TIMEOUT_HIDE; token->value.data = PTRTOSKINOFFSET(skin_buffer, st); return 0; diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c index 99671815ca..ee99e8341c 100644 --- a/apps/plugins/mp3_encoder.c +++ b/apps/plugins/mp3_encoder.c @@ -1106,6 +1106,9 @@ int HuffmanCod1( short *ix, char *xr_sign, uint32_t begin, uint32_t end, int tbl case 13: l=3; s = (sgnv << 2) + (sgnw << 1) + sgny; break; case 14: l=3; s = (sgnv << 2) + (sgnw << 1) + sgnx; break; case 15: l=4; s = (sgnv << 3) + (sgnw << 2) + (sgnx << 1) + sgny; break; + default: /* bug fix */ + rb->splashf(HZ * 2, "bad input %d < or > array bounds", p); + return 0; } d = (ht_count[tbl][0][p] << l) + s; @@ -2687,9 +2690,17 @@ enum plugin_status plugin_start(const void* parameter) } rb->lcd_clear_display(); +#if LCD_WIDTH <= 128 + rb->lcd_putsxy(0, 30, "Conversion:"); + rb->lcd_putsxyf(0, 40,"%ld.%02lds ", tim/100, tim%100); + tim = frames * cfg.smpl_per_frm * 100 / (cfg.samplerate != 0 ? cfg.samplerate : 1); /* unit=.01s */ + rb->lcd_putsxy(0, 10, "WAV-Length:"); + rb->lcd_putsxyf(0, 20, "%ld.%02lds ", tim/100, tim%100); +#else rb->lcd_putsxyf(0, 30, " Conversion: %ld.%02lds ", tim/100, tim%100); - tim = frames * cfg.smpl_per_frm * 100 / cfg.samplerate; /* unit=.01s */ + tim = frames * cfg.smpl_per_frm * 100 / (cfg.samplerate != 0 ? cfg.samplerate : 1); /* unit=.01s */ rb->lcd_putsxyf(0, 20, " WAV-Length: %ld.%02lds ", tim/100, tim%100); +#endif rb->lcd_update(); rb->sleep(5*HZ); } |