Commit Graph

1385 Commits

Author SHA1 Message Date
Qball Cow
4447ce5065 Don't try to forever to get data when the sockets winds up in "temporary
unavailable" when streaming music. But give up after 100 times. This is
atm better then waiting until the connection gets back, because mpd
blocks on this.


git-svn-id: https://svn.musicpd.org/mpd/trunk@7052 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-11-28 14:00:56 +00:00
Avuton Olrich
5e085751f5 A better way to do the last patch (extremely minor patch)
git-svn-id: https://svn.musicpd.org/mpd/trunk@7042 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-11-21 14:02:03 +00:00
Avuton Olrich
6f11941e5e Fix Sun C 5.9 / C99 compatiblity
git-svn-id: https://svn.musicpd.org/mpd/trunk@7041 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-11-21 13:43:37 +00:00
Qball Cow
6050541d97 When parsing id3_frames take in account that there are different frames
and with different field types.
This fixes comments for id3v1 and id3v2


git-svn-id: https://svn.musicpd.org/mpd/trunk@7040 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-11-21 12:15:00 +00:00
Qball Cow
b8dfe42342 Disable seeking on streams, because of bug 1611. When playing ogg, the decoder seeks through the file then starts to play. This does not mix well with streams from websites. Stopping playback of an oggstream that is trying to stream will result in mpd hanging.
git-svn-id: https://svn.musicpd.org/mpd/trunk@7039 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-11-18 19:15:10 +00:00
Qball Cow
ec49c1d3d9 Fix wavpack endian issues, tested to work for 16bit. (after blowing my ears off with white noise)
git-svn-id: https://svn.musicpd.org/mpd/trunk@6952 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-10-03 16:11:01 +00:00
Qball Cow
cb9d1b3d27 Playlist queue patch (http://musicpd.org/mantis/view.php?id=1478) version 11.
This adds the following commands:
* queueid <id>		Add song <id> to the queue.
* dequeue <pos>		Remove song from <pos> from the queue
* queueinfo			List the queue

To the statusfield it adds the following entry:
playlistqueue:	<uid>		UID can be used by clients to track changes in the playlist queue.



git-svn-id: https://svn.musicpd.org/mpd/trunk@6927 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-26 08:25:35 +00:00
Eric Wong
3a03b89b48 inputPlugins/_ogg_common.c: fixup includes for new (1.1.4+ FLAC)
ogg_stream_type_detect may not be compiled correctly
when compiling FLAC (1.1.4+) without Vorbis

git-svn-id: https://svn.musicpd.org/mpd/trunk@6896 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-17 11:30:37 +00:00
Avuton Olrich
1337f33c62 Add oga extension for flac-1.2.1
git-svn-id: https://svn.musicpd.org/mpd/trunk@6888 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-14 22:15:38 +00:00
Eric Wong
34f3abd357 conf.c: remove extra semi-colon here, too
git-svn-id: https://svn.musicpd.org/mpd/trunk@6874 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-10 07:15:58 +00:00
Eric Wong
8b141ae54e buffer input while waiting for outputBuffer space in mp4 and (ogg)flac
Both mp4 and (ogg)flac inputPlugins got HTTP inputStream support
later in the game, so their calls to sendDataToOutputBuffer()
didn't get updated to support buffering while the outputBuffer
was full.  This fixes it.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6873 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-10 07:12:42 +00:00
Eric Wong
54339dfbc2 pcm_utils: gcc 2.95 compile fix (extra semi-colon)
git-svn-id: https://svn.musicpd.org/mpd/trunk@6872 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-10 07:12:37 +00:00
Eric Wong
38de8d0808 playerInit() is static
git-svn-id: https://svn.musicpd.org/mpd/trunk@6868 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-08 03:29:13 +00:00
Eric Wong
30ed6bcf22 inputStream_http: signal the server to close after all requests
We want the partial content goodies of HTTP/1.1 without
requiring persistent connections.  Persistent connections across
multiple HTTP requests don't really help in the case of MPD,
either, because our content is usually big and heavy.

Note: this puts MPD at the hands of the server to correctly
close() the TCP connection we're using.  If we connect to a
rogue server that keeps the connection alive even when request
not to, we'll spin :(  However, encountering such a server
is very unlikely...

git-svn-id: https://svn.musicpd.org/mpd/trunk@6867 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-08 01:06:29 +00:00
Eric Wong
251216a552 decode: fix seek when paused
We need to SIGCONT the decoder process to allow for seeking
while paused.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6864 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-07 01:17:09 +00:00
Eric Wong
45c9989849 get rid of unused DECODE_SUFFIX_* #defines
These haven't been used for several years

git-svn-id: https://svn.musicpd.org/mpd/trunk@6863 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-07 00:59:29 +00:00
Eric Wong
56274fd016 Once again get rid of busy waiting and use SIGSTOP for pause
The problems I had were related to the OSS driver and USB
device I was using.  The problems existed even with the old
busy-waiting scheme enabled.

OSS  - Bithead USB     => bad
ALSA - Bithead USB     => OK
OSS  - Onboard i8x0    => OK
ALSA - Onboard i8x0    => OK

bad - slow shutdown, pauses, dropped audio after pause/resume

git-svn-id: https://svn.musicpd.org/mpd/trunk@6861 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-06 01:07:49 +00:00
Eric Wong
7024700cc5 return to busy-waiting on pause for now..
Until we can fix it properly (or replace it with a cleaner event
system), I don't want this in trunk.  Currently there are
strange pauses when queueing and during shutdown that I can't
seem to figure out right away.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6860 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-06 00:45:34 +00:00
Eric Wong
fe584bb11c send SIGCONT to the player process whenever we need to busy wait on it
This fixes the problem of playlist moving/changnig while we're paused

Followup to r6822

git-svn-id: https://svn.musicpd.org/mpd/trunk@6859 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-06 00:19:33 +00:00
Eric Wong
b2ae8da509 conf: use getBoolBlockParam for block params, too
git-svn-id: https://svn.musicpd.org/mpd/trunk@6858 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-05 23:59:36 +00:00
Eric Wong
4a2122eaf4 conf: improved boolean config parameter handling from -ke
the force flag will issue FATAL() if an invalid value is
specified

git-svn-id: https://svn.musicpd.org/mpd/trunk@6857 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-05 23:59:33 +00:00
Eric Wong
ac58dce7df Redirect stdin *before* we establish a listen socket
This way we'll avoid listening on fd=0 and have a better
chance of having fd=0 as /dev/null

git-svn-id: https://svn.musicpd.org/mpd/trunk@6852 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-05 01:19:37 +00:00
Eric Wong
7992ff37d0 log: oops, fix a syntax error
(yes, it helps to actually compile code before committing it)

git-svn-id: https://svn.musicpd.org/mpd/trunk@6851 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-04 21:08:35 +00:00
Eric Wong
146485d0cb log: better bug avoidance for libraries incorrectly handling fd=0
We redirect stdin to /dev/null to work around a libao bug, but
this bug has been fixed in libao since 2003 (according to jat).

However, there are likely other bugs in other libraries (and
even our code!) that handle fd=0 incorrectly and I'd rather not
take the risk[1].  So So it's easiest to just keep
fd=0==/dev/null for now...

[1] - I've seen several of these myself...

git-svn-id: https://svn.musicpd.org/mpd/trunk@6849 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-04 19:45:24 +00:00
Eric Wong
203a5ed26d zeroconf: avoid passing NULLs to Avahi *_free() routines
This should fix Debian bug #428551
(mpd crashes when restarting the dbus daemon)

git-svn-id: https://svn.musicpd.org/mpd/trunk@6844 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-02 02:18:09 +00:00
Eric Wong
bbe8b0efd8 Fix endless loop when mpd is launched from a non-interactive shell.
Thanks to _noth_ for the patch, this fixes Mantis bug #1534

_noth_ wrote:
> When MPD is launched from a non-interactive shell, it enters an endless
> loop, filling up its error log file with "error accept()'ing" messages.
> This is caused by the fact that stdin is already closed when mpd starts
> up.  listenOnPort() opens up the first of its sockets as fd 0 (the first
> empty fd table position). Then, setup_log_output()->redirect_stdin()
> overwrites fd0 (fd=open("/dev/null",...); dup2(fd, STDIN_FILENO);)
> without checking if it corresponds to the actual standard input (or if
> it is open in the first place).  This means that listenSockets[0].fd now
> is a fd for /dev/null, thus doIOForInterfaces()->getConnections() can't
> accept(2) on it and fails with the above error. The attached patch fixes
> this for me.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6843 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-02 01:11:28 +00:00
Eric Wong
c2e742106f interface: fix IPV6 hostname buffer deallocation from automatics
The host buffer that hostname pointed to is no longer on the
stack by the time the SECURE() message is printed.  So make it
static and thus accessible to all.  We won't be calling this
stuff in the middle of a child process/thread/task, so there's
no

Also, hostname is a constant string we shouldn't modify, so mark
it as const char *.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6842 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-09-01 12:20:49 +00:00
Eric Wong
c5c8548ba2 inputPlugins/flac: improve error messages
For the default: case, just use the error message that libFLAC
provides instead of using something ambiguous.  Also, this gets
rid of long lines in the code, making it easier to digest.

Of course, we save ~100 bytes of text space in the process :)

git-svn-id: https://svn.musicpd.org/mpd/trunk@6830 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-28 05:01:19 +00:00
Eric Wong
cd6e584c35 log: cleanup: avoid "magic" numbers
We used a bare '15' in several places and it's not immediately
obvious where it came from.  This makes it more obvious

git-svn-id: https://svn.musicpd.org/mpd/trunk@6829 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-28 05:01:16 +00:00
J. Alexander Treuman
1b045d0672 removing debug messages from signal handlers
As unfortunate as it is to remove such useful debugging messages, it's
necessary to fix a potential deadlock with signal handling.  A bunch of
functions the debug functions call aren't safe to call from a signal
handler.  There are some alternate solutions, but they're neither pretty
nor simple.  So just remove them entirely for now.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6828 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-27 21:18:35 +00:00
J. Alexander Treuman
752bf24b74 interface: print whole debug message at once
Using SECURE once without a \n, and again with one, results in a timestamp
mid-line.  Let's not do that.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6827 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-27 21:10:44 +00:00
J. Alexander Treuman
8d89add8e7 adding \n to a bunch of error message strings
git-svn-id: https://svn.musicpd.org/mpd/trunk@6826 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-27 21:03:22 +00:00
Eric Wong
f18e524176 send SIGSTOP to player and decoder processes on pause, too
as with the stop command, this will cause the player and decoder
to suspend and not wake up hundreds of times a second to poll
a variable for wakeup.  This will reduce power consumption
on some CPUs while mpd is paused and not playing.

tests:

pause && unpause => OK

pause && stop && play => OK

pause && exit && restart w/statefile && unpause => OK

pause && block sound device && \
unpause => failed to open sound device \
=> still paused and suspended => unblock sound device &&
unpause => OK (playing)

In all cases, the player process releases the audio device
when paused before going into the suspended state.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6822 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-27 09:36:11 +00:00
Eric Wong
0f2e9ee662 export FATAL() with noreturn attribute
This attribute was set in log.c, but not exported to other
modules in log.h

This allows us to remove some unneccessary variable
initializations that were added in r6277.  I did
audioOutput_shout.c a bit differently, to avoid some
jumps.

before:
$ size src/mpd
text    data     bss     dec     hex filename
225546    4040   14600  244186   3b9da src/mpd

after:
$ size src/mpd
text    data     bss     dec     hex filename
224698    4040   14600  243338   3b68a src/mpd

git-svn-id: https://svn.musicpd.org/mpd/trunk@6821 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-27 08:05:55 +00:00
J. Alexander Treuman
fe4b16ed96 inputPlugins/mp3_plugin: parse LAME tags for ReplayGain info
Parse ReplayGain info in LAME tags and use it if no ID3v2 ReplayGain tags
are found.  This is currently a bit unsafe, as apparently some LAME tags
have bogus ReplayGain values.  But I'm finding a lot of MP3s with valid
LAME tags that fail the LAME tag CRC check.  So until I figure out why
that's happening, it's an unreliable method for checking if the LAME tag is
valid.

A big thanks to tmz for writing the original patch.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6798 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-22 16:42:08 +00:00
J. Alexander Treuman
5e1deab05f decode: close audio device after initial open if paused
Currently, if we start decoding while the pause flag is set, we open the
audio device and leave it opened, blocking other apps from using it.  The
obvious thing to do is to not open the audio device if the pause flag is
set, but the open call also sets the audio format.  Therefore I'm leaving
the open call in, and just closing it immediately afterwards if the pause
flag is set.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6745 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-12 19:23:48 +00:00
J. Alexander Treuman
d286294805 decode: reformatting for better readability
git-svn-id: https://svn.musicpd.org/mpd/trunk@6742 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-12 19:15:06 +00:00
J. Alexander Treuman
3fedc4d806 audioOutputs/audioOutput_shout: adding timers back
The shout plugin will now feign playback until the connect timeout is hit,
preventing connection attempts from blocking playback on local outputs.
Note that this patch is very different from remiss' original one.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6738 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-11 21:36:23 +00:00
Qball Cow
e195fb8100 Cleanup a outcommented debug statement
git-svn-id: https://svn.musicpd.org/mpd/trunk@6736 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-08-11 11:36:13 +00:00
Qball Cow
4811eadb4a Extra debug output
git-svn-id: https://svn.musicpd.org/mpd/trunk@6689 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-07-16 20:31:37 +00:00
J. Alexander Treuman
54e6b27989 log: flush the warning log after redirecting stderr to the log files
Previously, the warning log was only flushed if creating the db or logging
to stdout.  This meant that under normal circumstances (no db creation,
logging to files) the warning log was never flushed.  This caused a bug
when a warning was printed for each call to the status command where the
warning buffer would grow endlessly, eventually using more and more CPU to
reallocate it.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6660 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-29 18:41:02 +00:00
J. Alexander Treuman
5a2f854914 replayGain: adding DEBUG messages when computing scale
git-svn-id: https://svn.musicpd.org/mpd/trunk@6658 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-25 14:34:40 +00:00
J. Alexander Treuman
f66b834f8f inputPlugins/wavpack_plugin: enable ReplayGain code
Turns out the fix was as simple as specifying the OPEN_TAGS flag when
opening the file.  Thanks again to Kodest for figuring this one out.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6657 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-25 14:24:30 +00:00
J. Alexander Treuman
f83d1aa460 inputPlugins/wavpack_plugin: adding dummy code for ReplayGain support
This ReplayGain code is currently disabled because WavpackGetTagItem can't
seem to find replaygain_* fields in APEv2 tags (which is how wvgain stores
ReplayGain values).  Additionally, because APEv2 tags are stored at the end
of the file, this code is only implemented for regular files and not HTTP
streams.  Using HTTP seeking it *may* be possible to implement it for both.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6656 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-25 13:37:21 +00:00
J. Alexander Treuman
ac5a7c2d82 decode: prefer fileDecodeFunc over streamDecodeFunc for files
Only wavpack implements both fileDecodeFunc and streamDecodeFunc, and it's
fileDecodeFunc provides more functionality.  So try using that first.

This commit also fixes a bug where the plugin test loop wouldn't break once
a suitable plugin was found if it used fileDecodeFunc.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6655 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-25 13:22:51 +00:00
J. Alexander Treuman
ff6a8e2ade Updating Kodest's name/email.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6654 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-25 12:13:45 +00:00
J. Alexander Treuman
db47ab163a Adding WavPack support. Patch courtesy Kodest.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6651 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-24 20:40:04 +00:00
J. Alexander Treuman
df32eed2cc Use parsePath for the fifo output's path parameter.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6623 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-13 15:37:46 +00:00
J. Alexander Treuman
c734c13b5c Adding parsePath and making parseConfigFilePath use it.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6622 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-13 15:27:09 +00:00
J. Alexander Treuman
b496239e76 Adding FIFO audio output. This is pretty much identical to the old one,
except that it now uses a timer for throttling.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6621 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-06-13 14:15:30 +00:00
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
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
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
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
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
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
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
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
1945c7c948 Adding ioops.h to mpd_headers so that it gets included in the tarball.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6323 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-28 12:42:44 +00:00
J. Alexander Treuman
b9b39849d8 Increasing default buffer_before_play from 0% to 10%.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6290 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-27 13:12:02 +00:00
Avuton Olrich
5339f63a2b Fix compilation error (missing ,)
git-svn-id: https://svn.musicpd.org/mpd/trunk@6289 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-27 00:16:17 +00:00
J. Alexander Treuman
d306019f5c "unable open" -> "unable to open"
git-svn-id: https://svn.musicpd.org/mpd/trunk@6278 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 18:21:51 +00:00
J. Alexander Treuman
93e68adc79 After changing ERROR();exit() to FATAL(), gcc incorrectly detects some
uninitialized variables and non-returning functions that return.  Let's
tell it to stfu.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6277 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 18:20:53 +00:00
J. Alexander Treuman
bba444524e Changing all calls to ERROR() followed by exit(EXIT_FAILURE) with a single
call to FATAL().

git-svn-id: https://svn.musicpd.org/mpd/trunk@6276 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 18:15:54 +00:00
J. Alexander Treuman
dba45a5992 Cleaning up pcm_getSampleRateConverter.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6275 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 17:33:59 +00:00
J. Alexander Treuman
665ab83761 Exit with an error if channel count isn't 1 or 2.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6274 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 17:04:54 +00:00
J. Alexander Treuman
355d18a593 Make pcm_convertAudioFormat return the buffer size. This is necessary
because lsr may return less than the input buffer size, and the rest of the
audio code needs to know the new size.  This fixes the clicking that was
introduced with recent changes to the lsr code.  A huge thanks to remiss
for figuring this out.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6273 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 16:39:55 +00:00
J. Alexander Treuman
29819576eb weather -> whether
git-svn-id: https://svn.musicpd.org/mpd/trunk@6271 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 15:05:06 +00:00
J. Alexander Treuman
425c6e9502 Changing calls to strdup to xstrdup.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6270 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 15:04:54 +00:00
J. Alexander Treuman
d14a655901 Cleaning up addToStoredPlaylist. Now we call freeJustSong if adding a URL.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6269 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 15:00:38 +00:00
J. Alexander Treuman
f16e372871 Make sure StoredPlaylists always contain UTF-8 paths that are either
relative paths in the DB or URLs.  The main functional difference is that
playlistmove and playlistdelete will rewrite playlists in the correct
encoding and remove invalid lines instead of potentially modifying them.
The specific changes are:

appendSongToStoredPlaylist:
* Don't convert to FS charset
* Don't prepend music_directory if saving absolute paths

writeStoredPlaylistToPath:
* Convert to FS charset
* Prepend music_directory if saving absolute paths

loadStoredPlaylist:
* Make sure each line is either in the DB or a URL

loadPlaylist:
* Don't bother checking paths, since it's done in loadStoredPlaylist now

git-svn-id: https://svn.musicpd.org/mpd/trunk@6266 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 14:09:09 +00:00
J. Alexander Treuman
f4d959a07b More formatting/error message cleanups in storedPlaylist.c.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6265 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 00:48:53 +00:00
J. Alexander Treuman
fd645486a1 Don't call freeStoredPlaylist(sp) inside an if (!sp) block. It causes
segfaults.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6264 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26 00:28:07 +00:00
J. Alexander Treuman
fc094c08d3 Cleaning up formatting and error messages in storedPlaylist.c.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6263 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-25 20:25:11 +00:00
J. Alexander Treuman
2814b7cfc6 Reverting to the full lsr API. Turns out the simple API needs all of the
audio at once, so it won't work for us.  The old full API code was still
heavily broken, as each call to pcm_convertSampleRate() used the same
state, even if it was processing two streams of audio.  The new code keeps
a separate state for each audio stream that's being converted.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6255 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-24 21:15:37 +00:00
J. Alexander Treuman
7ba357a04e Adding rename command, for renaming stored playlists.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6246 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-24 18:07:19 +00:00
J. Alexander Treuman
0d7d2ebf80 Cleaning up error messages in storedPlaylist.c.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6245 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-24 17:25:21 +00:00
J. Alexander Treuman
c408bd5e90 Don't list playlists in lsinfo if the path isn't the root directory (they
can't be loaded anyway).

git-svn-id: https://svn.musicpd.org/mpd/trunk@6244 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-24 17:06:59 +00:00
J. Alexander Treuman
cee4ba72e1 Changing some DEBUG/ERROR/FATAL messages in the JACK plugin.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6232 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-23 12:24:12 +00:00
J. Alexander Treuman
495e1b6cf9 Tidying up pcm_utils.c a bit more.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6230 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-23 11:04:04 +00:00
J. Alexander Treuman
fbb3a94f17 Switching to the lsr simple API. The problem with the full API is that the
number of channels is specified when the converter state is created.
Previously this was only done once, thus breaking horribly when the input
audio suddenly had a different channel count.  A new state could be created
every time the number of channels changes, but this could happen many times
a second if resampling to two different formats at once.  The simple API
doesn't have this problem, as channel count is an argument to the
conversion function itself.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6229 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-23 10:31:07 +00:00
J. Alexander Treuman
a70ecdc00c Just specify mimeType as NULL in mpc's InputPlugin struct.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6225 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-22 23:34:26 +00:00
J. Alexander Treuman
407497c40a Split pcm_convertAudioFormat into separate functions for bitrate, channel,
and samplerate conversion.  This makes the code much easier to read, and
fixes a few bugs that were previously there.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6224 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-22 23:11:36 +00:00
J. Alexander Treuman
e6d7663b10 Cleaning up/correcting some comments.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6200 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-22 15:21:56 +00:00
J. Alexander Treuman
f2850a66f0 Reindenting
git-svn-id: https://svn.musicpd.org/mpd/trunk@6199 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-22 15:02:25 +00:00
J. Alexander Treuman
92ff09881a Fail loading the playlist on errors mid-file. The same code is used for
playlistadd, playlistdelete, etc. and would've caused the playlist to be
rewritten only up to the line with the error.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6133 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-16 20:35:13 +00:00
J. Alexander Treuman
6cfe421cd6 Committing pat's rewrite of the stored playlist code. This also adds two
new commands: playlistmove and playlistdelete.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6116 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-16 12:02:10 +00:00
J. Alexander Treuman
6f68587ad5 Changing "//" comments to "/* */" comments.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6112 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-15 23:23:09 +00:00
J. Alexander Treuman
f63c6ca86d Fixing some code that was rendered unreadable by indent.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5955 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-26 00:48:37 +00:00
J. Alexander Treuman
472e70e74e Forgot to change the associated fdprintf format to %li.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5952 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-26 00:13:14 +00:00
J. Alexander Treuman
dc4e2a3f5e Changing SearchStats.playTime from int to unsigned long.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5951 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-26 00:11:30 +00:00
J. Alexander Treuman
7a8a9c10e1 Adding count command. It's usage is identical to find, but instead of
returning a list of matching songs, the number of results and total play
time of the results are returned.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5950 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-25 23:46:11 +00:00
J. Alexander Treuman
ebaa3f4338 Set directory_dbModTime when writing the db, so that it will be set after
initial db creation.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5948 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-25 20:34:30 +00:00
J. Alexander Treuman
179ab7efe8 fials -> fails
git-svn-id: https://svn.musicpd.org/mpd/trunk@5947 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-25 20:18:47 +00:00
J. Alexander Treuman
18e20b8d2c Remove the now unused struct stat from initMp3Directory().
git-svn-id: https://svn.musicpd.org/mpd/trunk@5946 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-25 20:08:05 +00:00
J. Alexander Treuman
bf6da4f399 initMp3Directory() is only called when (re)creating the db, but before the
db file is written.  So don't try to set directory_dbModTime to the mtime
of the db file, since it will be incorrect.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5945 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-25 20:06:47 +00:00
J. Alexander Treuman
f67b6b896f Removing references to options.updateDB in main.c.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5944 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-25 18:47:34 +00:00
José Anarch
51ec5b1542 Only a few changes in jack_playAudio.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5909 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-11 17:41:10 +00:00
José Anarch
de5667b288 Now process and playAudio use mutexes.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5897 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-09 20:18:11 +00:00
J. Alexander Treuman
95c411224a Don't allow "true" as a value for use_mmap for consistency with other "yes
or no" parameters.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5896 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-09 13:05:50 +00:00
J. Alexander Treuman
b8341e6902 Cleaning up some comments.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5894 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-09 12:24:48 +00:00
J. Alexander Treuman
7dadabca8a When calling commandError(STDERR_FILENO, ...), don't set current_command to
NULL.  Doing so would mean future calls to commandError with a socket as an
argument will still write the error message to the error log, and not the
socket.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5891 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-08 15:41:38 +00:00
J. Alexander Treuman
74e75378ae If current_command is NULL when calling commandError, print the error
message and trailing new line to STDERR_FILENO along with the ACK, instead
of sending them over the socket.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5890 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-08 15:26:48 +00:00
J. Alexander Treuman
c825401760 Typo.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5889 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-08 15:25:18 +00:00
Avuton Olrich
a061da8fb5 The massive copyright update
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-05 03:22:33 +00:00
J. Alexander Treuman
059494e8e4 Don't stop decoding when unpausing fails because no audio device can be
opened.  Instead just remain in paused state.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5820 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-03 20:22:10 +00:00
J. Alexander Treuman
2caf18ad43 Reformatting some code.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5819 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-03 20:10:22 +00:00
J. Alexander Treuman
e3e4964f59 Adding tagtypes command to list available tag types (takes metadata_to_use
into account).

git-svn-id: https://svn.musicpd.org/mpd/trunk@5792 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-31 18:43:16 +00:00
J. Alexander Treuman
2215c1796d Set totalTime to 0 for MODs. If this isn't done, the totalTime of the
previous song played will be reused.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5791 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-31 18:07:27 +00:00
J. Alexander Treuman
5a734c0172 Disable looping MOD files played with libmikmod. Many MODs will loop
forever without this.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5790 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-31 17:50:59 +00:00
Avuton Olrich
ef0397bf5b Another patch from Jose
git-svn-id: https://svn.musicpd.org/mpd/trunk@5733 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-23 21:23:41 +00:00
Avuton Olrich
8553a98c84 Add new update from Jose for JACK
git-svn-id: https://svn.musicpd.org/mpd/trunk@5729 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-23 11:07:04 +00:00
J. Alexander Treuman
c2c4852620 Doing those previous SONG_* commits properly. Thanks to normalperson for
pointing it out.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5673 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-20 21:05:42 +00:00
J. Alexander Treuman
28c2a1e433 Use "file" instead of SONG_INFO (literally "file: ") for
LOCATE_TAG_KEY_FILE.  Specifying "file: " as an argument to
search/find/list wasn't the point of that patch...

git-svn-id: https://svn.musicpd.org/mpd/trunk@5670 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-20 20:22:23 +00:00
J. Alexander Treuman
2630b5a30f Use SONG_FILE instead of literal "file: " for consistency with db code.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5669 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-20 20:16:25 +00:00
J. Alexander Treuman
80dea15184 Use SONG_TIME instead of literal "Time: " for consistency with db code.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5668 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-20 20:12:53 +00:00
J. Alexander Treuman
ce2efb48d5 This fixes a bug where a client sending just the right data could cause mpd
to segfault.  This could be exploited by malicious users to crash other
users' mpd.  But more importantly, I believe clients are doing this
unintentionally, and that this is what is causing mpd to segfault for many
people after running for long periods of time.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5649 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-18 01:19:08 +00:00
Warren Dukes
b1d50567c6 fix bug #1458
git-svn-id: https://svn.musicpd.org/mpd/trunk@5589 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-09 14:44:09 +00:00
J. Alexander Treuman
d93e939557 Support for libmikmod 3.2.0 betas.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5492 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-03-02 12:14:18 +00:00
J. Alexander Treuman
befd2776bc Removing a useless block.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5460 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-28 12:34:36 +00:00
J. Alexander Treuman
7ca84d3166 Adding copyright headers to locate.[ch].
git-svn-id: https://svn.musicpd.org/mpd/trunk@5422 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-24 03:14:00 +00:00
J. Alexander Treuman
6e64bac7b6 Adding playlistfind and playlistsearch commands for searching the current
playlist.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5420 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-24 02:00:03 +00:00
J. Alexander Treuman
1ae3bdb7e6 Moving a bunch of the LocateTagItem code to locate.[ch] so that it can
later be used for playlist searching.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5419 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-24 00:54:54 +00:00
Qball Cow
d7e20861d4 Make mpd fetch the Original artist/performer tag from mp3's
git-svn-id: https://svn.musicpd.org/mpd/trunk@5418 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-23 20:39:39 +00:00
Eric Wong
08a7a86be2 pcm_utils: fix libsamplerate compilation with non-C99 compilers
Mixing code and declarations is ugly, anyways.

We could probably get away with using alloca(), but I'm not sure
how good compiler support is for that, either.  It's probably
more supported than mixed declarations and code.  Nevertheless;
we'll trigger memory checkers on exit because we don't free
the buffers; but we won't actually leak because we reuse those
buffers (just like the non-SRC code path).

git-svn-id: https://svn.musicpd.org/mpd/trunk@5397 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-19 07:58:08 +00:00
Eric Wong
658b8f53df More (v)snprintf-related buffer over-allocations removed
Also took out an unnecessary memset in getPlayerErrorStr

git-svn-id: https://svn.musicpd.org/mpd/trunk@5396 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-19 07:58:05 +00:00
Eric Wong
772dc6bc66 inputStream_http: cleanup GET request code (finishHTTPInit)
Avoid unnecessary memset to zero, snprintf always puts a
trailing '\0'.  We also have no need to subtract one from the
buffer we're snprintf-ing it to.

We also check the return value of snprintf to ensure it's not
too long.  I have a feeling we might as well avoid snprintf
altogether so we don't have to worry about buffer sizing/stack
overflow and just do a bunch of write(2)s, letting Nagle sort it
out...

Also, centralize some of the exit error handling in with
goto.  This makes the code a bit more consistent and
maintainable as well as reducing code and binary size.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5395 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-19 07:58:03 +00:00
Eric Wong
9372692127 inputStream_http: fix HTTP seeking
We need to identify ourselves as HTTP/1.1 so Range: works;
and so the server can return HTTP/1.1 instead of HTTP/1.0.

Tested against lighttpd 1.4.13

git-svn-id: https://svn.musicpd.org/mpd/trunk@5394 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-19 06:49:01 +00:00
J. Alexander Treuman
8b8d6ddbbd Removing a global initialization to 0.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5378 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-18 01:59:33 +00:00
J. Alexander Treuman
7a4e0162ae Closing some parenthesis around shank's email address in copyright headers.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5376 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-18 01:20:21 +00:00
J. Alexander Treuman
f8e78bf995 Re-adding a fix to log.c that got pulled with the localization reversion.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5374 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-18 01:00:54 +00:00
J. Alexander Treuman
7b1e14b8e8 Reverting all of my localization changes. It was a horrible
implementation, and fixing it is a big enough job that I don't know when
I'll get around to it.  Probably best just starting from scratch anyhow.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5373 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-18 00:42:22 +00:00
Warren Dukes
d7e8507eaf fix for bug #1447
git-svn-id: https://svn.musicpd.org/mpd/trunk@5369 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-18 00:06:20 +00:00
J. Alexander Treuman
81fd135651 Fixing some weird floating point comparison issue. Not exactly sure why
this fixes it though.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5338 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-13 23:47:41 +00:00
Warren Dukes
b54c7c64c0 #1) fix a few potential deadlock conditons in decode.c when crossfading is enabled
#2) fix a deadlock condition when attempting to seek if the decoder quit and returned to playerInit()

git-svn-id: https://svn.musicpd.org/mpd/trunk@5325 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-11 20:36:26 +00:00
J. Alexander Treuman
c5933a164a Fix a bug where mpd would complain about a proxy password being specified
and not a proxy user even when both are specified.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5324 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-06 03:25:29 +00:00
Avuton Olrich
79ef8ba248 Add libsamplerate support, old resampling is still an option, but this sounds much better for those who need it and don't want to use pulseaudio. Reviewed by shank/avuton.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5316 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-02-02 03:51:07 +00:00
Warren Dukes
96c5976ccc on second thought, comment out the debug statement so that users aren't potentially flooded
git-svn-id: https://svn.musicpd.org/mpd/trunk@5270 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-24 02:56:45 +00:00
Warren Dukes
2a92239cf1 add debug statement for bug #1380
git-svn-id: https://svn.musicpd.org/mpd/trunk@5269 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-24 02:53:16 +00:00
Qball Cow
b2488e469a Fix some error messages concerning _ao output driver
git-svn-id: https://svn.musicpd.org/mpd/trunk@5268 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-21 21:41:54 +00:00
Avuton Olrich
d7e3b80f62 José Anarch: JACK updates
git-svn-id: https://svn.musicpd.org/mpd/trunk@5267 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-20 21:04:32 +00:00
Avuton Olrich
51d7ab021c Committing posix_fadvise(); normalperson/jat reviewed. Appears fine. Fixes bug #1428.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5265 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-19 01:40:02 +00:00
J. Alexander Treuman
9a222cab6c Call initLocalization() earlier so that errors, --version, etc. output
correctly.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5264 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-17 16:06:21 +00:00
Eric Wong
298d5ce059 avahi: malloc => xmalloc
git-svn-id: https://svn.musicpd.org/mpd/trunk@5262 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 04:49:26 +00:00
Eric Wong
53427fb3d4 sparse: move extern declarations for plugins into header files
git-svn-id: https://svn.musicpd.org/mpd/trunk@5261 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 04:33:13 +00:00
Eric Wong
0a6d48c28e More sparse fixes now that we've re-enabled -Wmissing-prototypes
git-svn-id: https://svn.musicpd.org/mpd/trunk@5260 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 04:33:11 +00:00
Eric Wong
5220c2c991 avahi: use #ifdef instead of #if because AVAHI may not be defined at all
git-svn-id: https://svn.musicpd.org/mpd/trunk@5259 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 04:25:27 +00:00
Eric Wong
2c01b285c1 flac: workaround for type inconsistency between new/old read callback
size_t (1.1.3) makes a lot more sense, but older flac used unsigned
here...

git-svn-id: https://svn.musicpd.org/mpd/trunk@5258 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 04:25:24 +00:00
Eric Wong
d41de57bfe jack: fix type warning in error message
just casting to int because it's the simplest (%z is not
well-supported)

Noticed-by: avuton on a 64-bit machine

git-svn-id: https://svn.musicpd.org/mpd/trunk@5257 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 04:25:22 +00:00
Eric Wong
b443363aa6 Don't initialize globals to zero (or NULL)
Some compilers and linkers aren't smart enough to optimize this,
as global variables are implictly initialized to zero.  As a
result, binaries are a bit smaller as more goes in the .bss and
less in the text section.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5254 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 03:07:53 +00:00
Eric Wong
45716f877b flac/ogg/oggflac: keep old mime-types in addition to the new ones
We'll be dealing with legacy server configurations for a long
time to come.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5253 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 03:07:50 +00:00
Eric Wong
3c2d123ab9 jack: fix double-free in finish routine
git-svn-id: https://svn.musicpd.org/mpd/trunk@5252 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:29 +00:00
Eric Wong
f894e98950 jack: fix potential segfaults in parsing bad configs for 'ports'
git-svn-id: https://svn.musicpd.org/mpd/trunk@5251 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:27 +00:00
Eric Wong
e1ee4505de jack: fix multiple segfaults when jackd hasn't been started
git-svn-id: https://svn.musicpd.org/mpd/trunk@5250 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:24 +00:00
Eric Wong
eb2a02dc2b jack: strdup => xstrdup for error checking
git-svn-id: https://svn.musicpd.org/mpd/trunk@5249 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:22 +00:00
Eric Wong
8a1b85c1a5 avahi: more sparse fixes (-Wshadow, non-ANSI declarations)
git-svn-id: https://svn.musicpd.org/mpd/trunk@5248 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:20 +00:00
Eric Wong
6b9fc56839 jack: declare global variables as static
There's no reason they shouldn't be static.  Additionally,
output_ports doesn't need to be initialized to NULLs; that is
(and has always been) implicit (for all global variables)

git-svn-id: https://svn.musicpd.org/mpd/trunk@5247 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:18 +00:00
Eric Wong
71bcc16588 mp3: sparse: fix warnings reported with -Wshadow
sendDataToOutputBuffer returns an int (and always has), and
using the existing 'ret' is fine in mp3Read().

git-svn-id: https://svn.musicpd.org/mpd/trunk@5246 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:16 +00:00
Eric Wong
5ae84b7d0f localization: fix implicit declaration warnings (WARNING and strcmp)
just added the missing includes.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5245 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:14 +00:00
Eric Wong
598be943ac flac: sparse: mismatched enum type for seek
git-svn-id: https://svn.musicpd.org/mpd/trunk@5244 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:11 +00:00
Eric Wong
931c980558 zeroconf: avoid mixing declarations and code
git-svn-id: https://svn.musicpd.org/mpd/trunk@5243 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:09 +00:00
Eric Wong
8a38b28e86 inputStream_http: stop mixing declarations with code
git-svn-id: https://svn.musicpd.org/mpd/trunk@5242 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:07 +00:00
Eric Wong
1d9b6076cb flac: fix a stupid mistake newer preprocessors don't complain about
FLAC__{seekable_,}_stream_decoder_new() takes no arguments

git-svn-id: https://svn.musicpd.org/mpd/trunk@5241 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14 02:08:05 +00:00
Jim Ramsay
5d79aced8c Added zeroconf service publishing using avahi
git-svn-id: https://svn.musicpd.org/mpd/trunk@5238 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-11 20:41:17 +00:00
Qball Cow
2d985b01c2 Remove a line of dead code
git-svn-id: https://svn.musicpd.org/mpd/trunk@5235 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-11 14:47:12 +00:00
J. Alexander Treuman
44c5549b46 Output warning messages in the current locale's charset.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5229 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-08 05:04:08 +00:00
J. Alexander Treuman
4989672ac0 Fixed some silly logic that caused an extra \n to be printed when flushing
warning messages.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5228 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-08 05:01:28 +00:00
J. Alexander Treuman
438c1add9d Convert log messages sent to stdout to the current locale's charset.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5227 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-08 04:31:44 +00:00
J. Alexander Treuman
90b4af0341 Moving pathConvCharset to charConv.c so it can be reused for localization.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5226 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-08 03:28:36 +00:00