summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/module-virtual-sink.c10
-rw-r--r--src/modules/rtp/rtp.h3
2 files changed, 8 insertions, 5 deletions
diff --git a/src/modules/module-virtual-sink.c b/src/modules/module-virtual-sink.c
index bad159ce..58ea932d 100644
--- a/src/modules/module-virtual-sink.c
+++ b/src/modules/module-virtual-sink.c
@@ -483,6 +483,7 @@ int pa__init(pa_module*m) {
pa_sink_new_data sink_data;
pa_bool_t use_volume_sharing = FALSE;
pa_bool_t force_flat_volume = FALSE;
+ pa_memchunk silence;
pa_assert(m);
@@ -606,12 +607,11 @@ int pa__init(pa_module*m) {
u->sink->input_to_master = u->sink_input;
- /* (9) IF YOU REQUIRE A FIXED BLOCK SIZE MAKE SURE TO PASS A
- * SILENCE MEMBLOCK AS LAST PARAMETER
- * HERE. pa_sink_input_get_silence() IS USEFUL HERE. */
- 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);
- /* (10) INITIALIZE ANYTHING ELSE YOU NEED HERE */
+ /* (9) INITIALIZE ANYTHING ELSE YOU NEED HERE */
pa_sink_put(u->sink);
pa_sink_input_put(u->sink_input);
diff --git a/src/modules/rtp/rtp.h b/src/modules/rtp/rtp.h
index b197e82f..e975e750 100644
--- a/src/modules/rtp/rtp.h
+++ b/src/modules/rtp/rtp.h
@@ -40,6 +40,9 @@ typedef struct pa_rtp_context {
} pa_rtp_context;
pa_rtp_context* pa_rtp_context_init_send(pa_rtp_context *c, int fd, uint32_t ssrc, uint8_t payload, size_t frame_size);
+
+/* If the memblockq doesn't have a silence memchunk set, then the caller must
+ * guarantee that the current read index doesn't point to a hole. */
int pa_rtp_send(pa_rtp_context *c, size_t size, pa_memblockq *q);
pa_rtp_context* pa_rtp_context_init_recv(pa_rtp_context *c, int fd, size_t frame_size);