summaryrefslogtreecommitdiff
path: root/src/lib/ecore_audio
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-04-25 17:27:13 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-04-26 18:49:24 +0100
commit3b70c0bc83552a26b89879aed42293de1e00b090 (patch)
tree509c51120454d8a0e0efd9fe2490052695ddc335 /src/lib/ecore_audio
parent911790b2367589ff922767f5144b0313ab8550d8 (diff)
ecore_audio: Zero copy in pulse output
Using pa_stream_write_begin we can just request a buffer to write into This reduces the amount of calloc()/free() and memcpy calls. Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
Diffstat (limited to 'src/lib/ecore_audio')
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_pulse.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
index 4c43d399cf..bdb193dd64 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
@@ -78,16 +78,16 @@ static void _write_cb(pa_stream *stream, size_t len, void *data)
78 78
79 void *buf; 79 void *buf;
80 ssize_t bread; 80 ssize_t bread;
81 size_t wlen = len;
81 82
82 buf = malloc(len); 83 pa_stream_begin_write(stream, &buf, &wlen);
83 84
84 eo_do(in, ecore_audio_obj_in_read(buf, len, &bread)); 85 eo_do(in, ecore_audio_obj_in_read(buf, wlen, &bread));
85 pa_stream_write(stream, buf, bread, free, 0, PA_SEEK_RELATIVE); 86
87 pa_stream_write(stream, buf, bread, NULL, 0, PA_SEEK_RELATIVE);
86 if (bread < (int)len) 88 if (bread < (int)len)
87 { 89 {
88 pa_operation_unref(pa_stream_trigger(stream, NULL, NULL)); 90 pa_operation_unref(pa_stream_trigger(stream, NULL, NULL));
89 //in->ended = EINA_TRUE;
90 //pa_operation_unref(pa_stream_drain(stream, NULL, NULL));
91 } 91 }
92} 92}
93 93