mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Undo unwanted commit r29310.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29311 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
237ca504e1
commit
e3abdb1a52
9 changed files with 36 additions and 36 deletions
|
@ -303,7 +303,7 @@ static int info_speak_item(int selected_item, void * data)
|
||||||
{
|
{
|
||||||
talk_id(LANG_BATTERY_TIME, false);
|
talk_id(LANG_BATTERY_TIME, false);
|
||||||
talk_value(battery_level(), UNIT_PERCENT, true);
|
talk_value(battery_level(), UNIT_PERCENT, true);
|
||||||
talk_value(battery_time() *60, UNIT_TIME, true);
|
talk_value(battery_time() *60, UNIT_TIME_EXACT, true);
|
||||||
}
|
}
|
||||||
else talk_id(VOICE_BLANK, false);
|
else talk_id(VOICE_BLANK, false);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -358,7 +358,8 @@ static int parseuser( struct mp3entry* entry, char* tag, int bufferpos )
|
||||||
|
|
||||||
if ((tag - entry->id3v2buf + desc_len + 2) < bufferpos) {
|
if ((tag - entry->id3v2buf + desc_len + 2) < bufferpos) {
|
||||||
/* At least part of the value was read, so we can safely try to
|
/* At least part of the value was read, so we can safely try to
|
||||||
* parse it */
|
* parse it
|
||||||
|
*/
|
||||||
value = tag + desc_len + 1;
|
value = tag + desc_len + 1;
|
||||||
value_len = bufferpos - (tag - entry->id3v2buf);
|
value_len = bufferpos - (tag - entry->id3v2buf);
|
||||||
|
|
||||||
|
@ -367,7 +368,8 @@ static int parseuser( struct mp3entry* entry, char* tag, int bufferpos )
|
||||||
entry->albumartist = tag;
|
entry->albumartist = tag;
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
} else {
|
} else {
|
||||||
value_len = parse_replaygain(tag, value, entry, tag, value_len);
|
value_len = parse_replaygain(tag, value, entry, tag,
|
||||||
|
value_len);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1038,12 +1040,6 @@ void setid3v2title(int fd, struct mp3entry *entry)
|
||||||
#endif
|
#endif
|
||||||
if( tr->ppFunc )
|
if( tr->ppFunc )
|
||||||
bufferpos = tr->ppFunc(entry, tag, bufferpos);
|
bufferpos = tr->ppFunc(entry, tag, bufferpos);
|
||||||
|
|
||||||
/* Trim. Take into account that multiple string contents will
|
|
||||||
* only be displayed up to their first null termination. All
|
|
||||||
* content after this null termination is obsolete and can be
|
|
||||||
* overwritten. */
|
|
||||||
bufferpos -= (bytesread - strlen(tag));
|
|
||||||
|
|
||||||
/* Seek to the next frame */
|
/* Seek to the next frame */
|
||||||
if(framelen < totframelen)
|
if(framelen < totframelen)
|
||||||
|
|
|
@ -337,10 +337,7 @@ long parse_tag(const char* name, char* value, struct mp3entry* id3,
|
||||||
p = NULL;
|
p = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do not overwrite already available metadata. Especially when reading
|
if (p)
|
||||||
* tags with e.g. multiple genres / artists. This way only the first
|
|
||||||
* of multiple entries is used, all following are dropped. */
|
|
||||||
if (p!=NULL && *p==NULL)
|
|
||||||
{
|
{
|
||||||
len = strlen(value);
|
len = strlen(value);
|
||||||
len = MIN(len, buf_remaining - 1);
|
len = MIN(len, buf_remaining - 1);
|
||||||
|
|
|
@ -73,6 +73,9 @@
|
||||||
#define MP4_udta FOURCC('u', 'd', 't', 'a')
|
#define MP4_udta FOURCC('u', 'd', 't', 'a')
|
||||||
#define MP4_extra FOURCC('-', '-', '-', '-')
|
#define MP4_extra FOURCC('-', '-', '-', '-')
|
||||||
|
|
||||||
|
/* Used to correct id3->samples, if SBR upsampling was detected in esds atom. */
|
||||||
|
static bool SBR_upsampling_used = false;
|
||||||
|
|
||||||
/* Read the tag data from an MP4 file, storing up to buffer_size bytes in
|
/* Read the tag data from an MP4 file, storing up to buffer_size bytes in
|
||||||
* buffer.
|
* buffer.
|
||||||
*/
|
*/
|
||||||
|
@ -117,17 +120,11 @@ static unsigned int read_mp4_tag_string(int fd, int size_left, char** buffer,
|
||||||
|
|
||||||
if (bytes_read)
|
if (bytes_read)
|
||||||
{
|
{
|
||||||
/* Do not overwrite already available metadata. Especially when reading
|
(*buffer)[bytes_read] = 0;
|
||||||
* tags with e.g. multiple genres / artists. This way only the first
|
*dest = *buffer;
|
||||||
* of multiple entries is used, all following are dropped. */
|
length = strlen(*buffer) + 1;
|
||||||
if (*dest == NULL)
|
*buffer_left -= length;
|
||||||
{
|
*buffer += length;
|
||||||
(*buffer)[bytes_read] = 0;
|
|
||||||
*dest = *buffer;
|
|
||||||
length = strlen(*buffer) + 1;
|
|
||||||
*buffer_left -= length;
|
|
||||||
*buffer += length;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -346,6 +343,11 @@ static bool read_mp4_esds(int fd, struct mp3entry* id3, uint32_t* size)
|
||||||
* decoding (parts of) the file.
|
* decoding (parts of) the file.
|
||||||
*/
|
*/
|
||||||
id3->frequency *= 2;
|
id3->frequency *= 2;
|
||||||
|
|
||||||
|
/* Set this to true to be able to calculate the correct runtime
|
||||||
|
* and bitrate. */
|
||||||
|
SBR_upsampling_used = true;
|
||||||
|
|
||||||
sbr = true;
|
sbr = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -638,7 +640,7 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
/* Reset to false. */
|
/* Reset to false. */
|
||||||
id3->needs_upsampling_correction = false;
|
id3->needs_upsampling_correction = true;
|
||||||
|
|
||||||
lseek(fd, 4, SEEK_CUR);
|
lseek(fd, 4, SEEK_CUR);
|
||||||
read_uint32be(fd, &entries);
|
read_uint32be(fd, &entries);
|
||||||
|
@ -652,12 +654,12 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
|
||||||
read_uint32be(fd, &n);
|
read_uint32be(fd, &n);
|
||||||
read_uint32be(fd, &l);
|
read_uint32be(fd, &l);
|
||||||
|
|
||||||
/* Some AAC file use HE profile. In this case the number
|
/* Some SBR files use upsampling. In this case the number
|
||||||
* of output samples is doubled to a maximum of 2048
|
* of output samples is doubled to a maximum of 2048
|
||||||
* samples per frame. This means that files which already
|
* samples per frame. This means that files which already
|
||||||
* report a frame size of 2048 in their header will not
|
* report a frame size of 2048 in their header will not
|
||||||
* need any further special handling. */
|
* need any further special handling. */
|
||||||
if (id3->codectype==AFMT_MP4_AAC_HE && l<=1024)
|
if (SBR_upsampling_used && l<=1024)
|
||||||
{
|
{
|
||||||
id3->samples += n * l * 2;
|
id3->samples += n * l * 2;
|
||||||
id3->needs_upsampling_correction = true;
|
id3->needs_upsampling_correction = true;
|
||||||
|
@ -772,6 +774,7 @@ static bool read_mp4_container(int fd, struct mp3entry* id3,
|
||||||
|
|
||||||
bool get_mp4_metadata(int fd, struct mp3entry* id3)
|
bool get_mp4_metadata(int fd, struct mp3entry* id3)
|
||||||
{
|
{
|
||||||
|
SBR_upsampling_used = false;
|
||||||
id3->codectype = AFMT_UNKNOWN;
|
id3->codectype = AFMT_UNKNOWN;
|
||||||
id3->filesize = 0;
|
id3->filesize = 0;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
|
|
@ -217,7 +217,7 @@ superdom.c
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if 1//#ifdef HAVE_TEST_PLUGINS /* enable in advanced build options */
|
#ifdef HAVE_TEST_PLUGINS /* enable in advanced build options */
|
||||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||||
test_boost.c
|
test_boost.c
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -883,7 +883,8 @@ menu:
|
||||||
boost_settings, 2, NULL);
|
boost_settings, 2, NULL);
|
||||||
goto menu;
|
goto menu;
|
||||||
}
|
}
|
||||||
rb->cpu_boost(boost ? true: false);
|
if(boost)
|
||||||
|
rb->cpu_boost(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (result == QUIT)
|
if (result == QUIT)
|
||||||
|
|
|
@ -805,7 +805,7 @@ static int runtime_speak_data(int selected_item, void* data)
|
||||||
talk_ids(false,
|
talk_ids(false,
|
||||||
(selected_item < 2) ? LANG_RUNNING_TIME : LANG_TOP_TIME,
|
(selected_item < 2) ? LANG_RUNNING_TIME : LANG_TOP_TIME,
|
||||||
TALK_ID((selected_item < 2) ? global_status.runtime
|
TALK_ID((selected_item < 2) ? global_status.runtime
|
||||||
: global_status.topruntime, UNIT_TIME));
|
: global_status.topruntime, UNIT_TIME_EXACT));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
apps/talk.c
12
apps/talk.c
|
@ -1015,7 +1015,7 @@ int talk_number(long n, bool enqueue)
|
||||||
|
|
||||||
/* Say time duration/interval. Input is time in seconds,
|
/* Say time duration/interval. Input is time in seconds,
|
||||||
say hours,minutes,seconds. */
|
say hours,minutes,seconds. */
|
||||||
static int talk_time_unit(long secs, bool enqueue)
|
static int talk_time_unit(long secs, bool exact, bool enqueue)
|
||||||
{
|
{
|
||||||
int hours, mins;
|
int hours, mins;
|
||||||
if (!enqueue)
|
if (!enqueue)
|
||||||
|
@ -1026,9 +1026,11 @@ static int talk_time_unit(long secs, bool enqueue)
|
||||||
}
|
}
|
||||||
if((mins = secs/60)) {
|
if((mins = secs/60)) {
|
||||||
secs %= 60;
|
secs %= 60;
|
||||||
talk_value(mins, UNIT_MIN, true);
|
if(exact || !hours)
|
||||||
|
talk_value(mins, UNIT_MIN, true);
|
||||||
|
else talk_number(mins, true); /* don't say "minutes" */
|
||||||
}
|
}
|
||||||
if((secs) || (!hours && !mins))
|
if((exact && secs) || (!hours && !mins))
|
||||||
talk_value(secs, UNIT_SEC, true);
|
talk_value(secs, UNIT_SEC, true);
|
||||||
else if(!hours && secs)
|
else if(!hours && secs)
|
||||||
talk_number(secs, true);
|
talk_number(secs, true);
|
||||||
|
@ -1108,8 +1110,8 @@ int talk_value_decimal(long n, int unit, int decimals, bool enqueue)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* special case for time duration */
|
/* special case for time duration */
|
||||||
if (unit == UNIT_TIME)
|
if (unit == UNIT_TIME || unit == UNIT_TIME_EXACT)
|
||||||
return talk_time_unit(n, enqueue);
|
return talk_time_unit(n, unit == UNIT_TIME_EXACT, enqueue);
|
||||||
|
|
||||||
if (unit < 0 || unit >= UNIT_LAST)
|
if (unit < 0 || unit >= UNIT_LAST)
|
||||||
unit_id = -1;
|
unit_id = -1;
|
||||||
|
|
|
@ -50,7 +50,8 @@ enum {
|
||||||
UNIT_MB, /* Megabytes */
|
UNIT_MB, /* Megabytes */
|
||||||
UNIT_KBIT, /* kilobits per sec */
|
UNIT_KBIT, /* kilobits per sec */
|
||||||
UNIT_PM_TICK, /* peak meter units per tick */
|
UNIT_PM_TICK, /* peak meter units per tick */
|
||||||
UNIT_TIME, /* time duration/interval in seconds, says hours,mins,secs */
|
UNIT_TIME_EXACT,/* time duration/interval in seconds, says hours,mins,secs*/
|
||||||
|
UNIT_TIME, /* as above but less verbose */
|
||||||
UNIT_LAST /* END MARKER */
|
UNIT_LAST /* END MARKER */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue