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.
This commit is contained in:
kleines Filmröllchen 2021-08-17 00:52:45 +02:00 committed by Andreas Kling
commit a9cbdcbcd0
Notes: sideshowbarker 2024-07-18 05:31:27 +09:00

View file

@ -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()) {