version 0.43
[FAPG] / fapg.c
diff --git a/fapg.c b/fapg.c
index 0c72af8..bd2b3f0 100644 (file)
--- a/fapg.c
+++ b/fapg.c
@@ -768,6 +768,9 @@ void parse_mp3(unsigned char *file)
                     /* genre=atoi(&genrebuf[1]); */
                     genre = atoi(c + 12);
                 }
+                if(strncmp(c, "TLEN", 4) == 0) {
+                    duration = atoi(c + 11) / 1000;
+                }
                 c += size + 10;
             }
     }
@@ -1335,12 +1338,10 @@ void parse_file(unsigned char *newpath, unsigned char * original_path)
         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;