diff options
author | Michael Hohmuth <sideral@rockbox.org> | 2011-06-06 23:03:31 +0000 |
---|---|---|
committer | Michael Hohmuth <sideral@rockbox.org> | 2011-06-06 23:03:31 +0000 |
commit | f9f96325e20be46d1cf12492818485f2f84c3c3a (patch) | |
tree | ca1b2834c45375ac513689f07e1cf4fdf88d94c7 | |
parent | 6a0021cf2044e2bc36883a63362cbc7657bf5fe0 (diff) | |
download | rockbox-f9f96325e20be46d1cf12492818485f2f84c3c3a.tar.gz rockbox-f9f96325e20be46d1cf12492818485f2f84c3c3a.zip |
FS#12107: Remove track-number guessing code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29982 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/tagcache.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index a3585feea5..973cc9314e 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c | |||
@@ -1870,36 +1870,9 @@ static void __attribute__ ((noinline)) add_tagcache(char *path, | |||
1870 | 1870 | ||
1871 | logf("-> %s", path); | 1871 | logf("-> %s", path); |
1872 | 1872 | ||
1873 | /* Generate track number if missing. */ | 1873 | if (id3.tracknum <= 0) /* Track number missing? */ |
1874 | if (id3.tracknum <= 0) | ||
1875 | { | 1874 | { |
1876 | const char *p = strrchr(path, '.'); | 1875 | id3.tracknum = -1; |
1877 | |||
1878 | if (p == NULL) | ||
1879 | p = &path[strlen(path)-1]; | ||
1880 | |||
1881 | while (*p != '/') | ||
1882 | { | ||
1883 | if (isdigit(*p) && isdigit(*(p-1))) | ||
1884 | { | ||
1885 | tracknumfix[1] = *p--; | ||
1886 | tracknumfix[0] = *p; | ||
1887 | break; | ||
1888 | } | ||
1889 | p--; | ||
1890 | } | ||
1891 | |||
1892 | if (tracknumfix[0] != '\0') | ||
1893 | { | ||
1894 | id3.tracknum = atoi(tracknumfix); | ||
1895 | /* Set a flag to indicate track number has been generated. */ | ||
1896 | entry.flag |= FLAG_TRKNUMGEN; | ||
1897 | } | ||
1898 | else | ||
1899 | { | ||
1900 | /* Unable to generate track number. */ | ||
1901 | id3.tracknum = -1; | ||
1902 | } | ||
1903 | } | 1876 | } |
1904 | 1877 | ||
1905 | /* Numeric tags */ | 1878 | /* Numeric tags */ |