Don't skip printing EXTINF for unknown durations
authorFrançois Revol <revol@free.fr>
Mon, 23 Mar 2020 18:17:40 +0000 (19:17 +0100)
committerAntoine Jacquet <royale@zerezo.com>
Fri, 27 Mar 2020 17:09:05 +0000 (18:09 +0100)
It is perfectly valid to use -1 when duration isn't known.

fapg.c

diff --git a/fapg.c b/fapg.c
index 0c72af8..745e6ae 100644 (file)
--- a/fapg.c
+++ b/fapg.c
@@ -1335,12 +1335,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;