Commit Graph

1724 Commits

Author SHA1 Message Date
J. Alexander Treuman 8de17dbed0 Use <= when comparing (current time - start time) to a timeout. This way
if the clock ticks right after we get the start time and the timeout is
only one second, we'll still wait a full second instead of returning
immediately.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6557 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-12 18:33:26 +00:00
J. Alexander Treuman 6f2be47270 Make the shout timeout configurable. The default is still 2 seconds.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6556 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-12 18:28:57 +00:00
J. Alexander Treuman 3c5cecb828 Redoing remiss's shout patch. This time, just block on open() instead of
pretending to play while we wait for the connection to timeout.  This
removes the need for timers, and thus removes the now unnecessary
timer_get_runtime_* function(s) from the timer code.

The changes made compared to the pre-patch shout plugin are:
* Block while connecting, timing out after 2 seconds.
* Close the device, and not just the connection, if play returns -1.
* Remove sd->last_err (it's always assigned before use).
* Some minor cleanups.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6555 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-12 17:58:17 +00:00
J. Alexander Treuman bd0620ff72 Load shout first instead of last. This makes it more likely to block other
outputs, which is actually desired behaviour.  This way if the shout server
takes a while to respond, the shout output can block until connected
without messing up other audio outputs.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6554 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-12 17:49:31 +00:00
J. Alexander Treuman 2d8f36cefb Load the shout plugin last. This will make sure it's played to last,
reducing the likelyhood of it blocking other outputs.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6543 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-10 22:58:56 +00:00
J. Alexander Treuman 4e5cffaa7b If an audio output is in state DEVICE_ENABLE, and openAudioOutput fails,
leave it in that state.  Likewise, if an audio output is in state
DEVICE_ON, and reopening the device due to a format change fails, change it
to state DEVICE_ENABLE.  This will prevent flushAudioBuffer from even
attempting to play audio on a closed device (even though it would fail
anyway).

git-svn-id: https://svn.musicpd.org/mpd/trunk@6529 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-09 21:40:56 +00:00
J. Alexander Treuman 8feaf84b24 Tidying up some code.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6527 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-09 19:19:33 +00:00
J. Alexander Treuman 0bfe6cabce Remove a useless if (quit) block. It's enclosed in two while loops: the
top depending on !quit, which doesn't set it anywhere before the if (quit)
block is reached, and the inner one which doesn't set quit at all.  Since
it's a local variable and can't be modified externally, it'll never be hit.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6524 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-09 16:04:00 +00:00
Roger Bystrøm d50fc3849a This should resolve some of the timing issues experienced after switching from blocking to non-blocking shout api
* Wait ten seconds before declearing the shout server unreachable
* Fix a state where it would never attempt to connect if it had previously failed

It isn't perfect yet, but I'd like some testing on it from other setups


git-svn-id: https://svn.musicpd.org/mpd/trunk@6523 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-09 15:51:20 +00:00
Roger Bystrøm 50fbab086a switching to us instead of ms on runtime
git-svn-id: https://svn.musicpd.org/mpd/trunk@6522 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-09 15:45:36 +00:00
Roger Bystrøm a886600474 Added timer_get_runtime_ms to know how long the timer has been running
git-svn-id: https://svn.musicpd.org/mpd/trunk@6521 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-09 14:03:09 +00:00
J. Alexander Treuman 9ccf0d8a25 Use string concatenation instead of snprintf for the User-Agent HTTP
header.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6520 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-09 13:43:40 +00:00
J. Alexander Treuman 9980d233c4 Tidying up some code.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6519 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-09 13:34:53 +00:00
Warren Dukes 52a06531fc dmix fix, don't call snd_pcm_drain unless we're already in the RUNNING
state (when users press stop, previous snd_pcm_drop(), then
snd_pcm_drain() was called.  this would lockup dmix)


git-svn-id: https://svn.musicpd.org/mpd/trunk@6517 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-08 12:44:38 +00:00
J. Alexander Treuman df95a80fa1 Send SIGCONT to the decode process before sending it SIGTERM.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6503 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-07 20:02:27 +00:00
J. Alexander Treuman 01faa6f4e3 Set a flag if we've sent the player process SIGSTOP so that we know not to
wait for it to complete an action which it never will.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6488 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-04 23:14:38 +00:00
J. Alexander Treuman 10860b33d4 Updating ChangeLog.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6487 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-04 22:43:57 +00:00
J. Alexander Treuman 0e4f418c29 Don't send the main process SIGUSR1 until we've sent the decode process
SIGSTOP.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6486 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-04 22:36:39 +00:00
J. Alexander Treuman 89eca9eebc Don't kill the player process (and effectively the decode process) when
completely stopped.  Instead, send them SIGSTOP to pause the process until
they're needed again.  Then send them SIGCONT instead of re-spawning them.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6485 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-04 22:29:55 +00:00
J. Alexander Treuman 4734a2e2b4 Adding very experimental streaming support for mp4.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6483 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-04 19:24:19 +00:00
J. Alexander Treuman cbdc0b1534 Use strncasecmp instead of strncmp when comparing HTTP headers. It seems
some versions of shoutcast send "content-type" in all lowercase, and I
don't trust other servers to get the case right for the rest of the headers
we look for.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6482 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-04 19:02:23 +00:00
J. Alexander Treuman caa17db85e Add MIME types for the aac and mp4 input plugins. Note that these won't
have any effect until the aac and mp4 input plugins actually support a
stream decoding API.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6481 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-04 18:57:34 +00:00
J. Alexander Treuman 71094905e3 Cleanup some formatting in decode.c.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6480 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-04 18:55:46 +00:00
J. Alexander Treuman 4685c782c4 Actually load the aac input plugin.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6479 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-04 18:54:46 +00:00
J. Alexander Treuman 1b68d00b3b Don't initialize zeroconf until after we've daemonized and log output has
been redirected.  This prevents zeroconf from blocking daemonization, and
makes sure any errors get sent to the logs and not stdout.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6477 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-04 17:41:18 +00:00
J. Alexander Treuman 652c2fc8b0 Adding ChangeLog entry for zeroconf_enabled, adding Zeroconf section to
mpdconf.example, and updating the zeroconf_* docs.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6474 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-03 20:09:12 +00:00
J. Alexander Treuman 7e2cbdee05 Removing that space that was recently added to the "Icy-Metadata: 1" HTTP
header.  While this is odd for an HTTP header, it's actually quite common
for streaming clients to send it without a space.  Some clients do send
with a space as well, but without one has always worked fine and may in
fact be more compatible.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6472 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-03 19:46:03 +00:00
J. Alexander Treuman d5596a1cf0 Define HAVE_ZEROCONF if Avahi or Bonjour support is enabled, so that we can
silence a warning about an unused variable without using stupid checks for
HAVE_AVAHI || HAVE_BONJOUR.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6471 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-03 19:44:19 +00:00
J. Alexander Treuman ab14f8a3c7 Oops, forgot to test that last bool commit. Fixing an error and warning.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6470 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-03 19:30:37 +00:00
J. Alexander Treuman f84bfb7c64 ChangeLog entry for Bonjour support.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6469 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-03 19:27:24 +00:00
J. Alexander Treuman a6fecd6c05 Making some bool options more consistent.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6468 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-03 19:25:25 +00:00
Patrik Weiskircher d67737bc64 allow zeroconf to be disabled.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6467 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-03 18:08:51 +00:00
J. Alexander Treuman 4025498488 Cleaning up zeroconf configure magic.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6464 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-03 00:03:20 +00:00
J. Alexander Treuman e41601c98b Check if we need -ldns_sd for Bonjour.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6463 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-02 22:58:51 +00:00
J. Alexander Treuman f3be4e8c91 Adding a missing include.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6462 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-02 22:52:53 +00:00
J. Alexander Treuman 5f8d6d6900 Removing some commented code that wrote HTTP streams to stdout.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6461 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-02 21:32:59 +00:00
Patrik Weiskircher b91af54d2a Added Bonjour zeroconf support. This works now natively on MacOS X.
I couldn't test mDNSResponder support on Linux, as Debian doesn't include it - but should work as well.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6453 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-02 17:06:08 +00:00
J. Alexander Treuman 7b07a45dc4 Someone forgot a space in the "Icy-Metadata: 1" HTTP header.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6452 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-02 16:48:54 +00:00
J. Alexander Treuman dd83898064 Requiring autoconf 2.60. This is needed for the new C99 and POSIX type
checks that are now used.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6447 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-01 18:32:25 +00:00
J. Alexander Treuman 6d7e0eb166 Tell the player process (and thus also the decode process) to quit when
playback is stopped completely.  This means the player process will no
longer have to wake up 100 times per second to see if it's been told to
start playing (the main process will just spawn a new player process when
it needs to).  On the downside, this means an extra pair of forks() and the
re-initializing of the player and decode processes each time playback is
restarted.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6446 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-01 18:10:13 +00:00
J. Alexander Treuman 88638f4821 Removing the getBoundPort() function and just making boundPort an extern.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6445 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-01 17:44:03 +00:00
J. Alexander Treuman 485d1f68dd Minor formatting cleanups.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6444 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-01 12:53:13 +00:00
J. Alexander Treuman 38c258dd9a Starting 0.14.0 ChangeLog entry.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6403 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-30 20:19:12 +00:00
J. Alexander Treuman aaea59e501 Bumping version numbers to 0.14.0.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6402 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-30 20:12:32 +00:00
J. Alexander Treuman 72cbcef0c0 Forgot a change to configure.ac in one of the previous commits.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6401 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-30 20:08:24 +00:00
J. Alexander Treuman bc95aa0e12 Only call finishDriverFunc if there is one. The null plugin doesn't have
one now, and trying to call NULL was causing a segfault at exit.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6398 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-30 18:31:38 +00:00
J. Alexander Treuman 693dc37851 Move the timing code from the null plugin to timer.c, so it can be easily
used in other plugins (fifo, shout, etc.).

git-svn-id: https://svn.musicpd.org/mpd/trunk@6397 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-30 18:16:35 +00:00
J. Alexander Treuman 41d65da4bd Adding a null output to mpdconf.example.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6394 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-30 16:58:39 +00:00
J. Alexander Treuman 0f8ab01c3e Adding a null output plugin.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6393 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-30 16:52:56 +00:00
J. Alexander Treuman 4155cd9940 Updating libFLAC.m4 so that -L isn't erroneously specified without an
argument.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6324 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-28 13:01:08 +00:00