From f5b5db6cc36f84e5cd21481a6f5d6de0c17d1087 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 23 Mar 2020 19:33:57 +0100 Subject: [PATCH] Parse ID3v2.3 TLEN as a fallback for duration detection Some files (VBR?) don't get the duration detected properly, so we use this as a default value. --- fapg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fapg.c b/fapg.c index 745e6ae..bd2b3f0 100644 --- 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; } } -- 2.20.1