Andre Noll [Sun, 17 Jan 2010 20:30:27 +0000 (21:30 +0100)]
[btr]: Avoid a gcc warning.
Although the warning
warning: 'brs[1]' may be used uninitialized in this function
is clearly bogus, it can't hurt to assert that i == 2 which also makes the warning to away.
Andre Noll [Fri, 15 Jan 2010 05:46:03 +0000 (06:46 +0100)]
btr support for para_client.
The use of the client code in audiod requires a node to be inserted
as the _parent_ of some existing node, which was not neccessary
before. Therefore a new btrn pointer for the child node is added to
struct btr_node_description and btr_new_node() is adjusted accordingly.
The patch also adds a small helper sched_request_barrier() to
the scheduler.
Andre Noll [Thu, 14 Jan 2010 03:19:59 +0000 (04:19 +0100)]
Introduce btr_node_description.
As the number of arguments to btr_new_node() grows, the code becomes
hard to read, especially since some callers must set many of the
arguments to NULL.
Using a pointer to a struct has the additional advantage that adding
new parameters does no longer require to touch all callers.
Andre Noll [Wed, 13 Jan 2010 23:11:46 +0000 (00:11 +0100)]
[btr] Fix merge_input_pool().
This function contained the following bug: wbr, buf1 and sz1 could
be used without being initialized. This was sometimes hitting the
assertion (buf1 && buf2).
Fix this by initializing these variables at the top.
Andre Noll [Tue, 12 Jan 2010 00:10:36 +0000 (01:10 +0100)]
vss: Fix offset handling.
Commit fb6d93240 (vss: Update offset directly when setting the REPOS
flag.) was buggy. On pause/restart we miss to update mmd->offset,
hence the status items which are sent to the stat clients like audiod
did not contain the correct offset value either which messes up
the time string that audiod sends to its clients (para_gui).
We need to set the new offset both on repos requests and on restart,
do introduce a small helper function for this purpose.
Andre Noll [Tue, 12 Jan 2010 00:01:34 +0000 (01:01 +0100)]
audiod: Fix a bug in try_to_close_slot() for default config.
If the default writer is used because no --writer option was given,
a->num_writers is zero although we have one (the default) writer.
Handle this case correctly to avoid starting the receiver too early.
Andre Noll [Sun, 10 Jan 2010 17:40:40 +0000 (18:40 +0100)]
stdin: Use buffer pools.
This introduces a memory leak to be fixed in a subsequent patch (the
buffer pool can not be freed in post_select() because there might
still be references to its area).
Andre Noll [Sat, 9 Jan 2010 21:25:17 +0000 (22:25 +0100)]
Add btr pool support to the fecdec filter.
The consumers of the output of fecdec are typically the decoders
which have requirements on the minimal amount of data available
in one chunk. Using a buffer pool minimizes the number of memcpy()
operations needed during btr_merge when the current buffer is too small.
To fit the needs of fecdec, a new function btr_copy() is introduced
which copies a data buffer into the btr pool area and generates
btr buffers and references. btr_add_output_pool() had to be adjusted
a bit and all callers have been changed to match.
The patch also adds a new field "name" to the buffer_pool structure.
This makes the log output more readable.
Andre Noll [Sat, 9 Jan 2010 17:41:07 +0000 (18:41 +0100)]
udp_recv: Use buffer pool API.
Although fecdec, the filter receiving the output of the udp receiver,
does not strictly benefit from this change, using buffer pools in
receivers has the advantage that we don't need to guess the input
buffer size or call realloc() after the receive to shrink the buffer.
Andre Noll [Sat, 9 Jan 2010 00:31:16 +0000 (01:31 +0100)]
oggdec fixes.
If opening the stream fails because the segment available is too small,
we must not consume this data, which is what cb_read_btr() does
unconditionally.
Make it store the number of consumed bytes in pod->converted and consume
from ogg_init() and ogg_post_select() instead.