aboutsummaryrefslogtreecommitdiffstats
path: root/test/run_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/run_output.c')
-rw-r--r--test/run_output.c48
1 files changed, 40 insertions, 8 deletions
diff --git a/test/run_output.c b/test/run_output.c
index 1a171198d..0e91bb3fd 100644
--- a/test/run_output.c
+++ b/test/run_output.c
@@ -22,6 +22,9 @@
#include "output_control.h"
#include "conf.h"
#include "audio_parser.h"
+#include "filter_registry.h"
+#include "pcm_convert.h"
+#include "event_pipe.h"
#include <glib.h>
@@ -29,12 +32,37 @@
#include <string.h>
#include <unistd.h>
+void
+event_pipe_emit(G_GNUC_UNUSED enum pipe_event event)
+{
+}
+
void pcm_convert_init(G_GNUC_UNUSED struct pcm_convert_state *state)
{
}
-void notify_init(G_GNUC_UNUSED struct notify *notify)
+void pcm_convert_deinit(G_GNUC_UNUSED struct pcm_convert_state *state)
+{
+}
+
+const void *
+pcm_convert(G_GNUC_UNUSED struct pcm_convert_state *state,
+ G_GNUC_UNUSED const struct audio_format *src_format,
+ G_GNUC_UNUSED const void *src, G_GNUC_UNUSED size_t src_size,
+ G_GNUC_UNUSED const struct audio_format *dest_format,
+ G_GNUC_UNUSED size_t *dest_size_r,
+ GError **error_r)
+{
+ g_set_error(error_r, pcm_convert_quark(), 0,
+ "Not implemented");
+ return NULL;
+}
+
+const struct filter_plugin *
+filter_plugin_by_name(G_GNUC_UNUSED const char *name)
{
+ assert(false);
+ return NULL;
}
static const struct config_param *
@@ -77,11 +105,7 @@ load_audio_output(struct audio_output *ao, const char *name)
int main(int argc, char **argv)
{
struct audio_output ao;
- struct audio_format audio_format = {
- .sample_rate = 44100,
- .bits = 16,
- .channels = 2,
- };
+ struct audio_format audio_format;
bool success;
GError *error = NULL;
char buffer[4096];
@@ -93,12 +117,19 @@ int main(int argc, char **argv)
return 1;
}
+ audio_format_init(&audio_format, 44100, 16, 2);
+
g_thread_init(NULL);
/* read configuration file (mpd.conf) */
config_global_init();
- config_read_file(argv[1]);
+ success = config_read_file(argv[1], &error);
+ if (!success) {
+ g_printerr("%s:", error->message);
+ g_error_free(error);
+ return 1;
+ }
/* initialize the audio output */
@@ -108,7 +139,8 @@ int main(int argc, char **argv)
/* parse the audio format */
if (argc > 3) {
- success = audio_format_parse(&audio_format, argv[3], &error);
+ success = audio_format_parse(&audio_format, argv[3],
+ false, &error);
if (!success) {
g_printerr("Failed to parse audio format: %s\n",
error->message);