FS#12107: Remove track-number guessing code.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29982 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Hohmuth 2011-06-06 23:03:31 +00:00
parent 6a0021cf20
commit f9f96325e2
1 changed files with 2 additions and 29 deletions

View File

@ -1870,36 +1870,9 @@ static void __attribute__ ((noinline)) add_tagcache(char *path,
logf("-> %s", path);
/* Generate track number if missing. */
if (id3.tracknum <= 0)
if (id3.tracknum <= 0) /* Track number missing? */
{
const char *p = strrchr(path, '.');
if (p == NULL)
p = &path[strlen(path)-1];
while (*p != '/')
{
if (isdigit(*p) && isdigit(*(p-1)))
{
tracknumfix[1] = *p--;
tracknumfix[0] = *p;
break;
}
p--;
}
if (tracknumfix[0] != '\0')
{
id3.tracknum = atoi(tracknumfix);
/* Set a flag to indicate track number has been generated. */
entry.flag |= FLAG_TRKNUMGEN;
}
else
{
/* Unable to generate track number. */
id3.tracknum = -1;
}
id3.tracknum = -1;
}
/* Numeric tags */