From 359c66982f75de62bcf3b461a8832ccc62b6893b Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 11 Mar 2022 03:16:51 -0500 Subject: [PATCH] playback.c use file_exists rather than open to check for bad files the worst case is really slow for open Change-Id: Ifcfe366ad9bee7ff43a0572e52f15b5c6f608288 --- apps/playback.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/playback.c b/apps/playback.c index cac28bd6e7..59d70842ee 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1907,11 +1907,13 @@ static int audio_load_track(void) break; /* Test for broken playlists by probing for the files */ - fd = open(path, O_RDONLY); - if (fd >= 0) - break; - - logf("Open failed"); + if (file_exists(path)) + { + fd = open(path, O_RDONLY); + if (fd >= 0) + break; + } + logf("Open failed %s", path); /* only skip if failed track has a successor in playlist */ if (!playlist_peek(playlist_peek_offset + 1, NULL, 0))