Merge pull request #135 from alenichev/master

Fix compilation error
Remove dead code in alac.c
Small socketlib static and return value tweaks
Improve resending of frames (and avoid missed frames)

- when requesting a packet, do not request an already received packet
- move the last-chance resend to buffer_get_frame
- check more often for missing frames
  own checks show that some frames need to be requested up to 4 times
  on bad connections
Removed typo in Makefile
Fix dependency issue in Makefile

Make the dependency and compile command match in the resources used.
Don't require extern usage of frame buffering value

This makes things a bit cleaner and easier to grasp.
hairtunes: use static keyword appropriately

This allows the compiler to do a much better job on this file, as it
currently can't inline most of the functions because they are
technically visible outside the file. Mark most functions and variables
static to let the compiler work.
Return the correct value from biquad_filt()

If you turned set `debug = 1` in hairtunes, you'd quickly get a mess of
debug messages that showed bf_est_drift in bf_est_update() going quicky
out of range toward a float NaN value (usually negative). Clearly the
presence of this `out` variable in biquad_filt was meant to be used, not
marked as unused.
Use a pthread mutex around the volume settings

Using the `volatile` qualifier in multithreading code is never the right
answer. Mutexes should be used as was attempted with the audio buffer
code. Here, we implement a new mutex for the volume and fix_volume
globals, and grab a lock on it when necessary, which is for both reads
and writes.
Use the audio buffer mutex appropriately

We need to use this any time we write to or access any of the
audio-buffer related variables. This also removes the need to use
'volatile', which cripples the compiler optimizations.
hairplay: various small code cleanups
Add static to some functions in alac.c
Use static where appropriate in shairport.c

Most functions don't need to be public outside of this file, so move all
the forward declarations out of shairport.h.
Tabs to spaces conversion
Merge pull request #138 from toofishes/cleanup

Cleanup, optimization, and bug fixes
hairtunes: simplify and reorganize some floating point operations

The math operations are all equivalent, but are simplified a bit for the
benefit of processors with slower floating point performance.

* Don't use float casts when we need to eventually convert to double
  precision anyway.
* Use multiplication instead of division when possible.
hairtunes: implement a simple LCG-based RNG for dithering

We are calling out to libc's rand() function, which has significant
overhead, especially since we are calling it 88200 times per second
(2 channels * 44100 samples).

Implement a very simple linear congruential generator in our code that
is plenty good enough for dithering purposes, and small enough for the
compiler to optimize and inline.
Merge pull request #139 from toofishes/math

hairtunes: math and dithering optimisations
Add support for mDNSPublish, from the howl zeroconf implementation.

Howl hasn't been actively developed for some years now; their website 404s,
and the Wayback Machine archive of 2008 says it's dead.[1] Yet it's still
functional and is much smaller than dbus and avahi, which makes it useful
for embedded systems. In fact, OpenWrt has not dropped support for the howl
tools, and it's because of howl that I can fit a functional shairport and
supporting libraries and kernel onto the 4MB of flash in a TP-LINK
TL-WR703N.[2]

[1] http://web.archive.org/web/20080917182117/http://www.porchdogsoft.com/products/howl/
[2] http://embeddedtimes.blogspot.com/2011/09/tp-link-tl-wr703n-tiny-linux-capable.html