1
0
Fork 0
forked from len0rd/rockbox

[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
This commit is contained in:
William Wilgus 2024-12-07 23:56:52 -05:00
parent bcc8c608e5
commit 9eb9e4ab22
2 changed files with 16 additions and 1 deletions

View file

@ -953,7 +953,11 @@ static int parse_timeout_tag(struct skin_element *element,
{ {
st->show = val; st->show = val;
st->hide = get_param(element, 1)->data.number; st->hide = get_param(element, 1)->data.number;
#ifndef __PCTOOL__
st->next_tick = current_tick; /* show immediately the first time */ 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->type = SKIN_TOKEN_SUBLINE_TIMEOUT_HIDE;
token->value.data = PTRTOSKINOFFSET(skin_buffer, st); token->value.data = PTRTOSKINOFFSET(skin_buffer, st);
return 0; return 0;

View file

@ -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 13: l=3; s = (sgnv << 2) + (sgnw << 1) + sgny; break;
case 14: l=3; s = (sgnv << 2) + (sgnw << 1) + sgnx; 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; 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; d = (ht_count[tbl][0][p] << l) + s;
@ -2687,9 +2690,17 @@ enum plugin_status plugin_start(const void* parameter)
} }
rb->lcd_clear_display(); 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); 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); rb->lcd_putsxyf(0, 20, " WAV-Length: %ld.%02lds ", tim/100, tim%100);
#endif
rb->lcd_update(); rb->lcd_update();
rb->sleep(5*HZ); rb->sleep(5*HZ);
} }