diff options
author | Max Kellermann <max@musicpd.org> | 2016-11-18 07:59:01 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-11-18 09:03:41 +0100 |
commit | 66fb352ccaac94a1ca5b6ac261ea15e790217f16 (patch) | |
tree | d9e2731f1a7398d11cf57c252e328f477f80c4a0 /test | |
parent | fd77acc217340aeee3dc80173b6000815ebb709f (diff) |
decoder/Client: add virtual method Ready()
Replaces decoder_initialized().
Diffstat (limited to 'test')
-rw-r--r-- | test/FakeDecoderAPI.cxx | 12 | ||||
-rw-r--r-- | test/FakeDecoderAPI.hxx | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/test/FakeDecoderAPI.cxx b/test/FakeDecoderAPI.cxx index 08e49e401..8b61ca5d3 100644 --- a/test/FakeDecoderAPI.cxx +++ b/test/FakeDecoderAPI.cxx @@ -29,22 +29,20 @@ #include <stdio.h> void -decoder_initialized(DecoderClient &client, - const AudioFormat audio_format, - gcc_unused bool seekable, - SignedSongTime duration) +FakeDecoder::Ready(const AudioFormat audio_format, + gcc_unused bool seekable, + SignedSongTime duration) { - auto &decoder = (FakeDecoder &)client; struct audio_format_string af_string; - assert(!decoder.initialized); + assert(!initialized); assert(audio_format.IsValid()); fprintf(stderr, "audio_format=%s duration=%f\n", audio_format_to_string(audio_format, &af_string), duration.ToDoubleS()); - decoder.initialized = true; + initialized = true; } DecoderCommand diff --git a/test/FakeDecoderAPI.hxx b/test/FakeDecoderAPI.hxx index 87a58a290..fadbbb5e8 100644 --- a/test/FakeDecoderAPI.hxx +++ b/test/FakeDecoderAPI.hxx @@ -30,6 +30,10 @@ struct FakeDecoder final : DecoderClient { Cond cond; bool initialized = false; + + /* virtual methods from DecoderClient */ + void Ready(AudioFormat audio_format, + bool seekable, SignedSongTime duration) override; }; #endif |