From dfd440bd5db50d3da6146a7f559e3a4f873f8810 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 1 Sep 2004 15:55:48 +0000 Subject: add sound file streaming git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@171 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/cli-command.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'polyp/cli-command.c') diff --git a/polyp/cli-command.c b/polyp/cli-command.c index 5a8ff177..1d2788fa 100644 --- a/polyp/cli-command.c +++ b/polyp/cli-command.c @@ -46,6 +46,7 @@ #include "play-memchunk.h" #include "autoload.h" #include "xmalloc.h" +#include "sound-file-stream.h" struct command { const char *name; @@ -516,10 +517,7 @@ static int pa_cli_command_scache_load(struct pa_core *c, struct pa_tokenizer *t, static int pa_cli_command_play_file(struct pa_core *c, struct pa_tokenizer *t, struct pa_strbuf *buf, int *fail, int *verbose) { const char *fname, *sink_name; - struct pa_memchunk chunk; - struct pa_sample_spec ss; struct pa_sink *sink; - int ret; assert(c && t && buf && fail && verbose); if (!(fname = pa_tokenizer_get(t, 1)) || !(sink_name = pa_tokenizer_get(t, 2))) { @@ -532,14 +530,8 @@ static int pa_cli_command_play_file(struct pa_core *c, struct pa_tokenizer *t, s return -1; } - if (pa_sound_file_load(fname, &ss, &chunk, c->memblock_stat) < 0) { - pa_strbuf_puts(buf, "Failed to load sound file.\n"); - return -1; - } - ret = pa_play_memchunk(sink, fname, &ss, &chunk, PA_VOLUME_NORM); - pa_memblock_unref(chunk.memblock); - return ret; + return pa_play_file(sink, fname, PA_VOLUME_NORM); } static int pa_cli_command_autoload_add(struct pa_core *c, struct pa_tokenizer *t, struct pa_strbuf *buf, int *fail, int *verbose) { -- cgit