aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-10-01 23:17:13 +0200
committerMax Kellermann <max@duempel.org>2012-10-02 00:18:18 +0200
commit43d82520502bc0c76fbd11d6e949739235166021 (patch)
tree3157bfc6f63a293509d2f3ca581f11bb6af02267 /src/output
parent674b4ab64735dac3b8113e09db4cdb9072ddacb7 (diff)
downloadmpd-43d82520502bc0c76fbd11d6e949739235166021.tar.gz
mpd-43d82520502bc0c76fbd11d6e949739235166021.tar.xz
mpd-43d82520502bc0c76fbd11d6e949739235166021.zip
output/recorder, test/*: invoke encoder_read() after _open()
Make sure the file header gets written at the beginning, before _write() gets called.
Diffstat (limited to 'src/output')
-rw-r--r--src/output/recorder_output_plugin.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/output/recorder_output_plugin.c b/src/output/recorder_output_plugin.c
index ea299468b..ad2d961d3 100644
--- a/src/output/recorder_output_plugin.c
+++ b/src/output/recorder_output_plugin.c
@@ -192,6 +192,13 @@ recorder_output_open(struct audio_output *ao,
return false;
}
+ if (!recorder_output_encoder_to_file(recorder, error_r)) {
+ encoder_close(recorder->encoder);
+ close(recorder->fd);
+ unlink(recorder->path);
+ return false;
+ }
+
return true;
}