From: François Revol Date: Mon, 23 Mar 2020 18:33:57 +0000 (+0100) Subject: Parse ID3v2.3 TLEN as a fallback for duration detection X-Git-Tag: v0.43~1 X-Git-Url: http://royale.zerezo.com/git/?p=FAPG;a=commitdiff_plain;h=f5b5db6cc36f84e5cd21481a6f5d6de0c17d1087 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. --- 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; } }