summaryrefslogtreecommitdiff
path: root/test/FakeDecoderAPI.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-05-22 11:24:40 +0200
committerMax Kellermann <max@duempel.org>2014-05-22 12:35:20 +0200
commitcc6f1020d01a6f8f814a6a6a211a00d490459f66 (patch)
treec54861d8c84ebc5accddefadbd1f2aba67ee7cb5 /test/FakeDecoderAPI.cxx
parent316ddc2382c8060e8a1604752ec5accbb6fd35e4 (diff)
test/run_decoder: merge code into FakeDecoderAPI.cxx
Eliminate duplicate code.
Diffstat (limited to 'test/FakeDecoderAPI.cxx')
-rw-r--r--test/FakeDecoderAPI.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/FakeDecoderAPI.cxx b/test/FakeDecoderAPI.cxx
index 4dfc545ee..155e7d5df 100644
--- a/test/FakeDecoderAPI.cxx
+++ b/test/FakeDecoderAPI.cxx
@@ -18,6 +18,7 @@
*/
#include "config.h"
+#include "FakeDecoderAPI.hxx"
#include "decoder/DecoderAPI.hxx"
#include "input/InputStream.hxx"
#include "util/Error.hxx"
@@ -26,11 +27,21 @@
#include <unistd.h>
void
-decoder_initialized(gcc_unused Decoder &decoder,
- gcc_unused const AudioFormat audio_format,
+decoder_initialized(Decoder &decoder,
+ const AudioFormat audio_format,
gcc_unused bool seekable,
- gcc_unused float total_time)
+ float duration)
{
+ struct audio_format_string af_string;
+
+ assert(!decoder.initialized);
+ assert(audio_format.IsValid());
+
+ fprintf(stderr, "audio_format=%s duration=%f\n",
+ audio_format_to_string(audio_format, &af_string),
+ duration);
+
+ decoder.initialized = true;
}
DecoderCommand