From a9cbdcbcd0307fd23dda357c457f4a3f149a39be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Tue, 17 Aug 2021 00:52:45 +0200 Subject: [PATCH] Utilities: Make aplay respect loader errors aplay would previously just retry a couple of times when the loader encountered an error, even though there is a standard mechanism for loaders to report errors. Now, aplay outputs these errors to the user and exits. --- Userland/Utilities/aplay.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Utilities/aplay.cpp b/Userland/Utilities/aplay.cpp index ae54ed329b..0dd8c93d4d 100644 --- a/Userland/Utilities/aplay.cpp +++ b/Userland/Utilities/aplay.cpp @@ -42,6 +42,10 @@ int main(int argc, char** argv) out("{}/{}", loader->loaded_samples(), loader->total_samples()); fflush(stdout); audio_client->enqueue(*samples); + } else if (loader->has_error()) { + outln(); + outln("Error: {}", loader->error_string()); + break; } else if (should_loop) { loader->reset(); } else if (audio_client->get_remaining_samples()) {