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...
Andre Noll [Sat, 19 Dec 2009 15:50:28 +0000 (16:50 +0100)]
audiod: Avoid starting the wrong decoder on server restarts.
If para_server is restarted and starts streaming using another audio format than
the one used before the restart, para_audiod might end up starting the decoder
associated with the old audio format.
Fix this by invalidating current_audio_format_num in close_stat_pipe() which is
called when the server goes away.
Andre Noll [Sat, 19 Dec 2009 13:14:45 +0000 (14:14 +0100)]
Do not include dependency files if make command goals contain "clean".
Calling "make clean2" was particularly annoying because it first regenerated the
dependency files it is supposed to remove.
Unfortunately, this patch breaks multiple goals if one of them matches "clean".
For example "make clean all" does no longer work. But as this can easily be worked
around by calling "make clean && make all", we don't care.
Andre Noll [Sat, 19 Dec 2009 12:13:53 +0000 (13:13 +0100)]
http_send: Send http OK message earlier.
Without this change, the http OK message is sent just when the vss is about to start
streaming, i.e. at the end of the announce interval. This might be too late and sometimes
causes the client to not receive the first chunk(s).
Fix this bug by adding the client file descriptor to the write fd set in http_preselect()
in case we received the get request (or something else) so that the following call
to select() will return immediately. The http OK message (or an error message) will
then be sent much earlier.
Andre Noll [Sat, 19 Dec 2009 00:19:18 +0000 (01:19 +0100)]
Avoid unnecessary regeneration of dependencies.
Change depend.sh so that it can handles foo.cmdline.h and cmdline/foo.cmdline.h
dependencies correctly. This way we no longer need to depend on $(cmdline_generated).