{
const char *c = path;
- printf(prefix); /* we must not modify this part */
+ printf("%s", prefix); /* we must not modify this part */
if(*c == '.' && c[1] == '/') { /* remove leading "./" when parsing current directory */
c += 2;
/* maybe there follow many slashes */
void print_path(const char *path)
{
const char *c = path;
- printf(prefix);
+ printf("%s", prefix);
/* skip leading "./" when parsing current directory */
if(*c == '.' && *(c + 1) == '/') {
c += 2;
pipe = popen(command, "r");
if(pipe == NULL) {
fprintf(stderr, "Warning >> can't open pipe >%s< !\n", command);
- free(command);
return;
}
fgets(buffer, 1020, pipe);
/* genre=atoi(&genrebuf[1]); */
genre = atoi(c + 12);
}
+ if(strncmp(c, "TLEN", 4) == 0) {
+ duration = atoi(c + 11) / 1000;
+ }
c += size + 10;
}
}
counter++;
switch (format) {
case FORMAT_M3U:
- if(duration != -1) {
- printf("#EXTINF:%d,", duration);
- if(strlen(artist) != 0)
- printf("%s - ", artist);
- printf("%s%s", title, eol);
- }
+ printf("#EXTINF:%d,", duration);
+ if(strlen(artist) != 0)
+ printf("%s - ", artist);
+ printf("%s%s", title, eol);
print_path(newpath);
printf("%s", eol);
break;