From: Andre Noll Date: Sun, 24 Nov 2019 16:33:51 +0000 (+0100) Subject: mp3_afh: Don't bail out on short files. X-Git-Tag: v0.6.3~26 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=53fe4aa13235ec51f8289b167bd429e405f2817b;ds=sidebyside mp3_afh: Don't bail out on short files. It's perfectly OK to have mp3 files which are shorter than two seconds. For example lexico.com offers mp3 downloads to learn the pronuciation of single words. These files are often shorter than one second. The check for short length files predates the git history. Most likely it was added for no good reason, so drop it. --- diff --git a/mp3_afh.c b/mp3_afh.c index f279cd57..728b25b8 100644 --- a/mp3_afh.c +++ b/mp3_afh.c @@ -675,7 +675,7 @@ static int mp3_get_file_info(char *map, size_t numbytes, int fd, ret = mp3_read_info((unsigned char *)map, numbytes, fd, afhi); if (ret < 0) return ret; - if (afhi->seconds_total < 2 || !afhi->chunks_total) + if (afhi->chunks_total == 0) return -E_MP3_INFO; return 1; }