test/DumpDecoderClient: convert to class

This commit is contained in:
Max Kellermann 2018-02-17 08:31:19 +01:00
parent 5909502a13
commit cc3c1f31d0
2 changed files with 8 additions and 3 deletions

View File

@ -29,11 +29,16 @@
* A #DecoderClient implementation which dumps metadata to stderr and * A #DecoderClient implementation which dumps metadata to stderr and
* decoded data to stdout. * decoded data to stdout.
*/ */
struct DumpDecoderClient final : DecoderClient { class DumpDecoderClient final : public DecoderClient {
bool initialized = false;
public:
Mutex mutex; Mutex mutex;
Cond cond; Cond cond;
bool initialized = false; bool IsInitialized() const noexcept {
return initialized;
}
/* virtual methods from DecoderClient */ /* virtual methods from DecoderClient */
void Ready(AudioFormat audio_format, void Ready(AudioFormat audio_format,

View File

@ -131,7 +131,7 @@ try {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (!client.initialized) { if (!client.IsInitialized()) {
fprintf(stderr, "Decoding failed\n"); fprintf(stderr, "Decoding failed\n");
return EXIT_FAILURE; return EXIT_FAILURE;
} }