summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaz Solc <tomaz.solc@tablix.org>2018-05-29 09:22:59 +0200
committerTanu Kaskinen <tanuk@iki.fi>2018-06-12 16:36:42 +0300
commit166b585072f4d8f228976705b8c3a7042db5f065 (patch)
tree45cab6959d674a35798217884e824140849d77fa
parente59e622e312b3c3e15a9a8a4413acb5006078c53 (diff)
downloadpulseaudio-166b585072f4d8f228976705b8c3a7042db5f065.tar.gz
cli-command: Report error in pa_play_file.
Current code does not check whether pa_play_file call failed. Hence no error is reported in the cli interface if playback failed because e.g. file isn't readable by the daemon.
-rw-r--r--src/pulsecore/cli-command.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index 44795b0d9..defdac1ec 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -1282,7 +1282,12 @@ static int pa_cli_command_play_file(pa_core *c, pa_tokenizer *t, pa_strbuf *buf,
return -1;
}
- return pa_play_file(sink, fname, NULL);
+ if (pa_play_file(sink, fname, NULL) < 0) {
+ pa_strbuf_puts(buf, "Failed to play sound file.\n");
+ return -1;
+ }
+
+ return 0;
}
static int pa_cli_command_list_shared_props(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, bool *fail) {