Parse ID3v2.3 TLEN as a fallback for duration detection
[FAPG] / fapg.c
diff --git a/fapg.c b/fapg.c
index 745e6ae..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;
             }
     }