summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sound-file-stream.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-08 21:51:30 +0100
committerColin Guthrie <cguthrie@mandriva.org>2010-02-09 22:29:38 +0000
commit345547853bcb0825c0afb5b2528a8f1d5339a8ea (patch)
treee59a2032ac562f60d419a1095f9b19fb432d8f05 /src/pulsecore/sound-file-stream.c
parent699233fb47d133f6ea1e36e8354a386c23608d5a (diff)
core: make sure we always return a valid memblock in sink_input_pop() callbacks
https://bugzilla.redhat.com/show_bug.cgi?id=553607
Diffstat (limited to 'src/pulsecore/sound-file-stream.c')
-rw-r--r--src/pulsecore/sound-file-stream.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pulsecore/sound-file-stream.c b/src/pulsecore/sound-file-stream.c
index 53674ba1..4037dca8 100644
--- a/src/pulsecore/sound-file-stream.c
+++ b/src/pulsecore/sound-file-stream.c
@@ -239,6 +239,7 @@ int pa_play_file(
pa_sink_input_new_data data;
int fd;
SF_INFO sfi;
+ pa_memchunk silence;
pa_assert(sink);
pa_assert(fname);
@@ -320,7 +321,9 @@ int pa_play_file(
u->sink_input->state_change = sink_input_state_change_cb;
u->sink_input->userdata = u;
- u->memblockq = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0, pa_frame_size(&ss), 1, 1, 0, NULL);
+ pa_sink_input_get_silence(u->sink_input, &silence);
+ u->memblockq = pa_memblockq_new(0, MEMBLOCKQ_MAXLENGTH, 0, pa_frame_size(&ss), 1, 1, 0, &silence);
+ pa_memblock_unref(silence.memblock);
pa_sink_input_put(u->sink_input);