Skip to content

Commit

Permalink
stream: make pa_stream_begin_write return whole frames
Browse files Browse the repository at this point in the history
  • Loading branch information
i-rinat committed Apr 18, 2017
1 parent fad28a1 commit ec575ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/apulse-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,16 @@ APULSE_EXPORT
int
pa_stream_begin_write(pa_stream *p, void **data, size_t *nbytes)
{
trace_info_f("F %s p=%p\n", __func__, p);
trace_info_f("F %s p=%p nbytes=%p(%" PRIu64 ")\n", __func__, p, nbytes,
(uint64_t)(nbytes ? *nbytes : 0));

free(p->write_buffer);

if (*nbytes == (size_t)-1)
*nbytes = 8192;

*nbytes = pa_find_multiple_of(*nbytes, pa_frame_size(&p->ss), 0);

p->write_buffer = malloc(*nbytes);

if (!p->write_buffer)
Expand Down

0 comments on commit ec575ce

Please sign in to comment.