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.
Andre Noll [Tue, 5 Jan 2010 18:04:04 +0000 (19:04 +0100)]
[btr] Add the node type parameter to btr_node_status().
This allows to have a single function which can be called from
both the pre_select and the post_select methods of all receivers/
filters/writers and from the stdin and stdout tasks.
Andre Noll [Mon, 4 Jan 2010 22:11:32 +0000 (23:11 +0100)]
Alsa improvement and fixes.
Wait until pending frames are played.
The old code was buggy because snd_pcm_drain() always fails on a
non-blocking fd. We therefore called snd_pcm_close() while frames
for playback are still availabe, causing the last few frames being
skipped.
Andre Noll [Mon, 21 Dec 2009 18:27:10 +0000 (19:27 +0100)]
Add -lm to the audiod ldflags.
Depending on the set of installed (optional) libraries, para_audiod gets or
does not get automatically linked against the math library. However, we always
need this lib as the wma decoder is always supported and uses trigonometric
functions.
If -lm is not automatically included, linking fails with many errors of the form
imdct.c:79: error: 'cos_16' undeclared here (not in a function)
Fix this problem by explicitely adding -lm to audiod's ldflags, just as we
do for para_filter as well.
Andre Noll [Mon, 21 Dec 2009 18:21:13 +0000 (19:21 +0100)]
__aligned is already defined on NetBSD.
Use __a_aligned in analogy to __a_unused which was introduced since __unused is
already defined on MacOS. This fixes the warning
gcc-compat.h:5:1: warning: "__aligned" redefined
In file included from /usr/include/regex.h:77,
from daemon.c:9:
/usr/include/sys/cdefs.h:202:1: warning: this is the location of the previous definition
on NetBSD and has the additional advantage that it keeps working even if the
NetBSD people decide to redefine __aligned.
Andre Noll [Mon, 21 Dec 2009 13:30:34 +0000 (14:30 +0100)]
Fix another gcc warning on older Mac OS.
Fixes
wmadec_filter.c: In function 'wma_decode_superframe':
wmadec_filter.c:1182: warning: format '%zd' expects type 'signed size_t', but argument 6 has type 'int'
Andre Noll [Mon, 21 Dec 2009 10:35:43 +0000 (11:35 +0100)]
wma: Fix two gcc warnings on Slow Leopard:
Fixes
wma_common.c: In function 'search_pattern':
wma_common.c:41: warning: format '%u' expects type 'unsigned int', but argument 5 has type 'long int'
wma_common.c: In function 'find_audio_stream_info':
wma_common.c:59: warning: format '%0x' expects type 'unsigned int', but argument 4 has type 'long int'
The cast is neccessary because the type of a pointer difference is
implementation-defined...