diff options
-rw-r--r-- | apps/menus/main_menu.c | 2 | ||||
-rw-r--r-- | apps/metadata/id3tags.c | 12 | ||||
-rw-r--r-- | apps/metadata/metadata_common.c | 5 | ||||
-rw-r--r-- | apps/metadata/mp4.c | 31 | ||||
-rw-r--r-- | apps/plugins/SOURCES | 2 | ||||
-rw-r--r-- | apps/plugins/test_codec.c | 3 | ||||
-rw-r--r-- | apps/screens.c | 2 | ||||
-rw-r--r-- | apps/talk.c | 12 | ||||
-rw-r--r-- | apps/talk.h | 3 |
9 files changed, 36 insertions, 36 deletions
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 6ee7ba4156..902e14b819 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c | |||
@@ -303,7 +303,7 @@ static int info_speak_item(int selected_item, void * data) | |||
303 | { | 303 | { |
304 | talk_id(LANG_BATTERY_TIME, false); | 304 | talk_id(LANG_BATTERY_TIME, false); |
305 | talk_value(battery_level(), UNIT_PERCENT, true); | 305 | talk_value(battery_level(), UNIT_PERCENT, true); |
306 | talk_value(battery_time() *60, UNIT_TIME, true); | 306 | talk_value(battery_time() *60, UNIT_TIME_EXACT, true); |
307 | } | 307 | } |
308 | else talk_id(VOICE_BLANK, false); | 308 | else talk_id(VOICE_BLANK, false); |
309 | break; | 309 | break; |
diff --git a/apps/metadata/id3tags.c b/apps/metadata/id3tags.c index 9143f8ad25..9ee183a1b3 100644 --- a/apps/metadata/id3tags.c +++ b/apps/metadata/id3tags.c | |||
@@ -358,7 +358,8 @@ static int parseuser( struct mp3entry* entry, char* tag, int bufferpos ) | |||
358 | 358 | ||
359 | if ((tag - entry->id3v2buf + desc_len + 2) < bufferpos) { | 359 | if ((tag - entry->id3v2buf + desc_len + 2) < bufferpos) { |
360 | /* At least part of the value was read, so we can safely try to | 360 | /* At least part of the value was read, so we can safely try to |
361 | * parse it */ | 361 | * parse it |
362 | */ | ||
362 | value = tag + desc_len + 1; | 363 | value = tag + desc_len + 1; |
363 | value_len = bufferpos - (tag - entry->id3v2buf); | 364 | value_len = bufferpos - (tag - entry->id3v2buf); |
364 | 365 | ||
@@ -367,7 +368,8 @@ static int parseuser( struct mp3entry* entry, char* tag, int bufferpos ) | |||
367 | entry->albumartist = tag; | 368 | entry->albumartist = tag; |
368 | #if CONFIG_CODEC == SWCODEC | 369 | #if CONFIG_CODEC == SWCODEC |
369 | } else { | 370 | } else { |
370 | value_len = parse_replaygain(tag, value, entry, tag, value_len); | 371 | value_len = parse_replaygain(tag, value, entry, tag, |
372 | value_len); | ||
371 | #endif | 373 | #endif |
372 | } | 374 | } |
373 | } | 375 | } |
@@ -1038,12 +1040,6 @@ void setid3v2title(int fd, struct mp3entry *entry) | |||
1038 | #endif | 1040 | #endif |
1039 | if( tr->ppFunc ) | 1041 | if( tr->ppFunc ) |
1040 | bufferpos = tr->ppFunc(entry, tag, bufferpos); | 1042 | bufferpos = tr->ppFunc(entry, tag, bufferpos); |
1041 | |||
1042 | /* Trim. Take into account that multiple string contents will | ||
1043 | * only be displayed up to their first null termination. All | ||
1044 | * content after this null termination is obsolete and can be | ||
1045 | * overwritten. */ | ||
1046 | bufferpos -= (bytesread - strlen(tag)); | ||
1047 | 1043 | ||
1048 | /* Seek to the next frame */ | 1044 | /* Seek to the next frame */ |
1049 | if(framelen < totframelen) | 1045 | if(framelen < totframelen) |
diff --git a/apps/metadata/metadata_common.c b/apps/metadata/metadata_common.c index 4f001775f3..e1ef9a0d62 100644 --- a/apps/metadata/metadata_common.c +++ b/apps/metadata/metadata_common.c | |||
@@ -337,10 +337,7 @@ long parse_tag(const char* name, char* value, struct mp3entry* id3, | |||
337 | p = NULL; | 337 | p = NULL; |
338 | } | 338 | } |
339 | 339 | ||
340 | /* Do not overwrite already available metadata. Especially when reading | 340 | if (p) |
341 | * tags with e.g. multiple genres / artists. This way only the first | ||
342 | * of multiple entries is used, all following are dropped. */ | ||
343 | if (p!=NULL && *p==NULL) | ||
344 | { | 341 | { |
345 | len = strlen(value); | 342 | len = strlen(value); |
346 | len = MIN(len, buf_remaining - 1); | 343 | len = MIN(len, buf_remaining - 1); |
diff --git a/apps/metadata/mp4.c b/apps/metadata/mp4.c index 26ab7cc30a..1ef3701e30 100644 --- a/apps/metadata/mp4.c +++ b/apps/metadata/mp4.c | |||
@@ -73,6 +73,9 @@ | |||
73 | #define MP4_udta FOURCC('u', 'd', 't', 'a') | 73 | #define MP4_udta FOURCC('u', 'd', 't', 'a') |
74 | #define MP4_extra FOURCC('-', '-', '-', '-') | 74 | #define MP4_extra FOURCC('-', '-', '-', '-') |
75 | 75 | ||
76 | /* Used to correct id3->samples, if SBR upsampling was detected in esds atom. */ | ||
77 | static bool SBR_upsampling_used = false; | ||
78 | |||
76 | /* Read the tag data from an MP4 file, storing up to buffer_size bytes in | 79 | /* Read the tag data from an MP4 file, storing up to buffer_size bytes in |
77 | * buffer. | 80 | * buffer. |
78 | */ | 81 | */ |
@@ -117,17 +120,11 @@ static unsigned int read_mp4_tag_string(int fd, int size_left, char** buffer, | |||
117 | 120 | ||
118 | if (bytes_read) | 121 | if (bytes_read) |
119 | { | 122 | { |
120 | /* Do not overwrite already available metadata. Especially when reading | 123 | (*buffer)[bytes_read] = 0; |
121 | * tags with e.g. multiple genres / artists. This way only the first | 124 | *dest = *buffer; |
122 | * of multiple entries is used, all following are dropped. */ | 125 | length = strlen(*buffer) + 1; |
123 | if (*dest == NULL) | 126 | *buffer_left -= length; |
124 | { | 127 | *buffer += length; |
125 | (*buffer)[bytes_read] = 0; | ||
126 | *dest = *buffer; | ||
127 | length = strlen(*buffer) + 1; | ||
128 | *buffer_left -= length; | ||
129 | *buffer += length; | ||
130 | } | ||
131 | } | 128 | } |
132 | else | 129 | else |
133 | { | 130 | { |
@@ -346,6 +343,11 @@ static bool read_mp4_esds(int fd, struct mp3entry* id3, uint32_t* size) | |||
346 | * decoding (parts of) the file. | 343 | * decoding (parts of) the file. |
347 | */ | 344 | */ |
348 | id3->frequency *= 2; | 345 | id3->frequency *= 2; |
346 | |||
347 | /* Set this to true to be able to calculate the correct runtime | ||
348 | * and bitrate. */ | ||
349 | SBR_upsampling_used = true; | ||
350 | |||
349 | sbr = true; | 351 | sbr = true; |
350 | } | 352 | } |
351 | } | 353 | } |
@@ -638,7 +640,7 @@ static bool read_mp4_container(int fd, struct mp3entry* id3, | |||
638 | unsigned int i; | 640 | unsigned int i; |
639 | 641 | ||
640 | /* Reset to false. */ | 642 | /* Reset to false. */ |
641 | id3->needs_upsampling_correction = false; | 643 | id3->needs_upsampling_correction = true; |
642 | 644 | ||
643 | lseek(fd, 4, SEEK_CUR); | 645 | lseek(fd, 4, SEEK_CUR); |
644 | read_uint32be(fd, &entries); | 646 | read_uint32be(fd, &entries); |
@@ -652,12 +654,12 @@ static bool read_mp4_container(int fd, struct mp3entry* id3, | |||
652 | read_uint32be(fd, &n); | 654 | read_uint32be(fd, &n); |
653 | read_uint32be(fd, &l); | 655 | read_uint32be(fd, &l); |
654 | 656 | ||
655 | /* Some AAC file use HE profile. In this case the number | 657 | /* Some SBR files use upsampling. In this case the number |
656 | * of output samples is doubled to a maximum of 2048 | 658 | * of output samples is doubled to a maximum of 2048 |
657 | * samples per frame. This means that files which already | 659 | * samples per frame. This means that files which already |
658 | * report a frame size of 2048 in their header will not | 660 | * report a frame size of 2048 in their header will not |
659 | * need any further special handling. */ | 661 | * need any further special handling. */ |
660 | if (id3->codectype==AFMT_MP4_AAC_HE && l<=1024) | 662 | if (SBR_upsampling_used && l<=1024) |
661 | { | 663 | { |
662 | id3->samples += n * l * 2; | 664 | id3->samples += n * l * 2; |
663 | id3->needs_upsampling_correction = true; | 665 | id3->needs_upsampling_correction = true; |
@@ -772,6 +774,7 @@ static bool read_mp4_container(int fd, struct mp3entry* id3, | |||
772 | 774 | ||
773 | bool get_mp4_metadata(int fd, struct mp3entry* id3) | 775 | bool get_mp4_metadata(int fd, struct mp3entry* id3) |
774 | { | 776 | { |
777 | SBR_upsampling_used = false; | ||
775 | id3->codectype = AFMT_UNKNOWN; | 778 | id3->codectype = AFMT_UNKNOWN; |
776 | id3->filesize = 0; | 779 | id3->filesize = 0; |
777 | errno = 0; | 780 | errno = 0; |
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index 4d7434d771..7afd97309f 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES | |||
@@ -217,7 +217,7 @@ superdom.c | |||
217 | 217 | ||
218 | 218 | ||
219 | 219 | ||
220 | #if 1//#ifdef HAVE_TEST_PLUGINS /* enable in advanced build options */ | 220 | #ifdef HAVE_TEST_PLUGINS /* enable in advanced build options */ |
221 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 221 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
222 | test_boost.c | 222 | test_boost.c |
223 | #endif | 223 | #endif |
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index 56aedda1c8..9b00fdbb95 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c | |||
@@ -883,7 +883,8 @@ menu: | |||
883 | boost_settings, 2, NULL); | 883 | boost_settings, 2, NULL); |
884 | goto menu; | 884 | goto menu; |
885 | } | 885 | } |
886 | rb->cpu_boost(boost ? true: false); | 886 | if(boost) |
887 | rb->cpu_boost(true); | ||
887 | #endif | 888 | #endif |
888 | 889 | ||
889 | if (result == QUIT) | 890 | if (result == QUIT) |
diff --git a/apps/screens.c b/apps/screens.c index 81472e6cc7..a11c4333ea 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -805,7 +805,7 @@ static int runtime_speak_data(int selected_item, void* data) | |||
805 | talk_ids(false, | 805 | talk_ids(false, |
806 | (selected_item < 2) ? LANG_RUNNING_TIME : LANG_TOP_TIME, | 806 | (selected_item < 2) ? LANG_RUNNING_TIME : LANG_TOP_TIME, |
807 | TALK_ID((selected_item < 2) ? global_status.runtime | 807 | TALK_ID((selected_item < 2) ? global_status.runtime |
808 | : global_status.topruntime, UNIT_TIME)); | 808 | : global_status.topruntime, UNIT_TIME_EXACT)); |
809 | return 0; | 809 | return 0; |
810 | } | 810 | } |
811 | 811 | ||
diff --git a/apps/talk.c b/apps/talk.c index 8c0f1f3a07..5fddf85986 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -1015,7 +1015,7 @@ int talk_number(long n, bool enqueue) | |||
1015 | 1015 | ||
1016 | /* Say time duration/interval. Input is time in seconds, | 1016 | /* Say time duration/interval. Input is time in seconds, |
1017 | say hours,minutes,seconds. */ | 1017 | say hours,minutes,seconds. */ |
1018 | static int talk_time_unit(long secs, bool enqueue) | 1018 | static int talk_time_unit(long secs, bool exact, bool enqueue) |
1019 | { | 1019 | { |
1020 | int hours, mins; | 1020 | int hours, mins; |
1021 | if (!enqueue) | 1021 | if (!enqueue) |
@@ -1026,9 +1026,11 @@ static int talk_time_unit(long secs, bool enqueue) | |||
1026 | } | 1026 | } |
1027 | if((mins = secs/60)) { | 1027 | if((mins = secs/60)) { |
1028 | secs %= 60; | 1028 | secs %= 60; |
1029 | talk_value(mins, UNIT_MIN, true); | 1029 | if(exact || !hours) |
1030 | talk_value(mins, UNIT_MIN, true); | ||
1031 | else talk_number(mins, true); /* don't say "minutes" */ | ||
1030 | } | 1032 | } |
1031 | if((secs) || (!hours && !mins)) | 1033 | if((exact && secs) || (!hours && !mins)) |
1032 | talk_value(secs, UNIT_SEC, true); | 1034 | talk_value(secs, UNIT_SEC, true); |
1033 | else if(!hours && secs) | 1035 | else if(!hours && secs) |
1034 | talk_number(secs, true); | 1036 | talk_number(secs, true); |
@@ -1108,8 +1110,8 @@ int talk_value_decimal(long n, int unit, int decimals, bool enqueue) | |||
1108 | #endif | 1110 | #endif |
1109 | 1111 | ||
1110 | /* special case for time duration */ | 1112 | /* special case for time duration */ |
1111 | if (unit == UNIT_TIME) | 1113 | if (unit == UNIT_TIME || unit == UNIT_TIME_EXACT) |
1112 | return talk_time_unit(n, enqueue); | 1114 | return talk_time_unit(n, unit == UNIT_TIME_EXACT, enqueue); |
1113 | 1115 | ||
1114 | if (unit < 0 || unit >= UNIT_LAST) | 1116 | if (unit < 0 || unit >= UNIT_LAST) |
1115 | unit_id = -1; | 1117 | unit_id = -1; |
diff --git a/apps/talk.h b/apps/talk.h index a2a9f44e4e..fc1bfe5a2d 100644 --- a/apps/talk.h +++ b/apps/talk.h | |||
@@ -50,7 +50,8 @@ enum { | |||
50 | UNIT_MB, /* Megabytes */ | 50 | UNIT_MB, /* Megabytes */ |
51 | UNIT_KBIT, /* kilobits per sec */ | 51 | UNIT_KBIT, /* kilobits per sec */ |
52 | UNIT_PM_TICK, /* peak meter units per tick */ | 52 | UNIT_PM_TICK, /* peak meter units per tick */ |
53 | UNIT_TIME, /* time duration/interval in seconds, says hours,mins,secs */ | 53 | UNIT_TIME_EXACT,/* time duration/interval in seconds, says hours,mins,secs*/ |
54 | UNIT_TIME, /* as above but less verbose */ | ||
54 | UNIT_LAST /* END MARKER */ | 55 | UNIT_LAST /* END MARKER */ |
55 | }; | 56 | }; |
56 | 57 | ||