commit 8e006e859081b250b0aa0cd4398a69939a97859d from: Omar Polo date: Wed Jul 13 10:14:39 2022 UTC fix mp3 length detection without a call to mpg123_scan the length returned by mpg123_length is not necessarly accurate (well, even in that case it's not guaranteed to be exact, i.e. if a file is modified while it's playing.) fixes the length reporting on some mp3 files i had around. commit - b72c076563d1642eda3aaa0c38169b674e3d9725 commit + 8e006e859081b250b0aa0cd4398a69939a97859d blob - 21f3b019133bd3132f1cae81b403ac3f8c9047ec blob + 550b4671180a345d23001ec9e52ccf20e591a9aa --- player_123.c +++ player_123.c @@ -66,6 +66,9 @@ play_mp3(int fd, const char **errstr) if (!setup(mh)) goto done; + if (mpg123_scan(mh) != MPG123_OK) + goto done; + player_setduration(mpg123_length(mh)); for (;;) {