Commit Graph

4059 Commits

Author SHA1 Message Date
Jochen Keil
4d3d091c22 Fix remove-flac-song-on-every-update
Until now every flac file got removed unconditionally (and then re-added)
whenever the update command was issued. Now there is a check if we need
to that, so the file will only be removed if there is a embedded cuesheet
in that file
2009-03-09 15:15:26 +01:00
Jochen Keil
706112bb88 Initial support for embedded cue sheets found in flac files
So far only seekpoints are supported, so no proper tagging yet
except for track number and track length.
Tagging should be done by parsing the cue sheet which
is often embedded as vorbis comment in flac files.
Furthermore the pathname should be configurable like "%A - %t - %T",
where %A means Artist, %t track number and %T Title or so.
2009-03-09 07:58:44 +01:00
Jochen Keil
ab3d89f484 decoder_plugin: added method container_scan()
[mk: fixed whitespace errors; use delete_song() instead of
songvec_delete()]
2009-03-09 07:58:26 +01:00
Max Kellermann
94d1a87d04 music_chunk: added assertions on the audio format
In !NDEBUG, remember which audio_format is stored in every chunk and
every pipe.  Check the audio_format of every new data block appended
to the music_chunk, and the format of every new chunk appended to the
music_pipe.
2009-03-08 13:45:24 +01:00
Max Kellermann
359f9871b2 output_thread: print "closed" debug message 2009-03-08 04:13:55 +01:00
Max Kellermann
ab656a52da alsa: determine buffer_time if not already known
This patch fixes a theoretical (but practically impossible) flaw: the
variable "buffer_time" may be uninitialized when it is used.
Initialize the variable with snd_pcm_hw_params_get_buffer_time().
2009-03-08 04:11:30 +01:00
Max Kellermann
554a34fb95 alsa: better period_time default value for high sample rates
The default values for buffer_time and period_time were both capped by
the hardware limits on practically all chips.  The result was a
period_time which was half as big as the buffer_time.  On some chips,
this led to lots of underruns when using a high sample rate (192 kHz),
because MPD had very little time to send new samples to ALSA.

A period time which is one fourth of the buffer time turned out to be
much better.  If no period_time is configured, see how much
buffer_time the hardware accepts, and try to configure one fourth of
it as period_time, instead of hard-coding the default period_time
value.

This is yet another attempt to provide a solution which is valid for
all sound chips.  Using the SND_PCM_NONBLOCK flag also seemed to solve
the underruns, but put a lot more CPU load to MPD.
2009-03-08 03:55:01 +01:00
Max Kellermann
27193d8402 output_all: fix boolean short circuit in update()
Sometimes, audio_output_update() isn't called for the second device
when the first one has succeeded.  The patch
"audio_output_all_update() returns bool" broke it, because the boolean
evaluation ended after the first "true".
2009-03-07 23:48:28 +01:00
Max Kellermann
fc6d836a2d player_thread: moved code to player_check_decoder_startup() 2009-03-07 23:11:43 +01:00
Max Kellermann
2ba5278440 configure.ac: fix --enable-bzip2 and --enable-iso9660 variable name
Another "remove redundant explicit $enableval assignments" breakage.
2009-03-07 23:05:25 +01:00
Max Kellermann
bd6bcfb676 music_pipe: refuse to push empty chunks
Added two assertions.
2009-03-07 21:41:25 +01:00
Max Kellermann
85cc46ad6f decoder_internal: don't push empty chunk into pipe
When the decoder chunk is empty in decoder_flush_chunk(), don't push
it into the music pipe - return it to the music buffer instead.  An
empty chunk in the pipe wastes resources for no advantage.
2009-03-07 21:41:23 +01:00
Max Kellermann
eb2e3a554d chunk: added music_chunk_is_empty() 2009-03-07 21:40:27 +01:00
Max Kellermann
f8aebc52b5 music_pipe: poison music_chunk.next
The value of music_chunk.next is undefined for a chunk returned by
music_pipe_shift().  For more pedantic debugging, poison the reference
before returning the chunk.
2009-03-07 21:40:13 +01:00
Max Kellermann
39d3521956 music_pipe: added music_pipe_peek()
music_pipe_peek() is similar to music_pipe_shift(), but doesn't remove
the chunk.  This allows it to be used with a "const" music_pipe.
2009-03-07 19:56:31 +01:00
Max Kellermann
b13cd03f75 output_all: audio_output_all_update() returns bool
audio_output_all_update() returns true when there is at least open
output device which is open.
2009-03-07 19:55:57 +01:00
David Guibert
498ec26f25 pulse_mixer: allow mpd to reconnect to the pulse mixer
This patch follows the commit 21bb10f4b.

>From Max Kellermann:
> I removed the daemonization changes in main.c.  Please explain why you
> changed that.  If you need it for some reason, make that a separate
> patch with a good description of your rationale.

> That's the biggest flaw of your code: it opens the mixer device in the
> init() method, while the open() method is empty.  When the pulse
> daemon is not available (either during MPD startup or when it dies
> while MPD runs), the plugin will not even attempt to reconnect to
> pulse.  Please move the code to the open() method, to make that work.

I changed the daemonize call as the fork losts the connection to the
pulse server. According to your remark, the init() method should be
moved to the open() ones.

With the modification, mpd is able to reconnect the pulse mixer after
restarting the pulseaudio daemon.

Signed-off-by: David Guibert <david.guibert@gmail.com>
Signed-off-by: Max Kellermann <max@duempel.org>
2009-03-07 19:55:09 +01:00
Max Kellermann
a1534ba7c2 AUTHORS: added Romain Bignon, Rasmus Steinke
Added two new team members.  Updated the description of older
contributors.  Moved José Anarch and Patrik Weiskircher to "former
developers".
2009-03-07 16:13:23 +01:00
Max Kellermann
5ffb2dd88c pulse_mixer: added missing copyright header 2009-03-07 15:59:29 +01:00
Max Kellermann
b1137fe81a pulse_mixer: added GLib log domain
Shorten some log messages, let GLib add the "pulse_mixer" prefix.
2009-03-07 15:59:26 +01:00
Max Kellermann
6069cafda0 pulse: clean up includes
Don't include output_api.h - this is not an output plugin.  Added
missing explicit conf.h and string.h includes.
2009-03-07 15:59:22 +01:00
David Guibert
21bb10f4bf pulse mixer
This patch introduces the mixer for the pulse output.

Technically speaking, the pulse index is needed to get or set
the volume. You must define callback fonctions to get this index since
the pulse output in mpd is done using the simpe api. The pulse simple api
does not provide the index of the newly defined output.

So callback fonctions are associated to the pulse context.
The list of all the sink input is then retreived.
Then we select the name of the mpd pulse output and control
its volume by its associated index number.

Signed-off-by: Patrice Linel <patnathanael@gmail.com>
Signed-off-by: David Guibert <david.guibert@gmail.com>

[mk: fixed whitespace errors and broke long lines; removed
daemonization changes from main.c]
2009-03-07 15:59:20 +01:00
Max Kellermann
a547d24eb2 mixer: check for init() failures
When the init() method of a mixer plugin fails, mixer_new()
dereferences the NULL pointer.
2009-03-07 15:50:26 +01:00
Max Kellermann
9ed409cdcc configure.ac: fix --enable-X variable names
The patch "remove redundant explicit $enableval assignments" broke
several options with non-standard variable names.
2009-03-07 15:50:19 +01:00
Avuton Olrich
55b0fed293 configure: global indention and trim line wc to 80 when practical. 2009-03-06 08:30:59 -08:00
Avuton Olrich
771c061964 configure: Move the faad stuff to m4/faad.m4 2009-03-06 08:30:59 -08:00
Avuton Olrich
aebb522639 configure: No capitalization on beginning of help strings.
Most strings have no capitalization at the beinning, make all strings
non-capital.
2009-03-06 08:30:59 -08:00
Avuton Olrich
67cecf4e95 configure: specify that faad2 prefix is optional in the help string 2009-03-06 08:30:59 -08:00
Avuton Olrich
bfdf68776f configure: trim down the line length for the libOggFLAC help strings 2009-03-06 08:30:59 -08:00
Avuton Olrich
cf1c27a232 configure: trim down the line length for the faad help strings 2009-03-06 08:30:59 -08:00
Avuton Olrich
775a277a10 configure: trim down the line length for the zeroconf help string 2009-03-06 08:30:59 -08:00
Avuton Olrich
5da410f913 configure: trim down the line length for the lame arguments 2009-03-06 08:30:59 -08:00
Avuton Olrich
7c907b9d9d configure: trim down the Tremor AC_ARG_WITH() statements 2009-03-06 08:30:59 -08:00
Avuton Olrich
bc65890abf configure: Group libmad stuff together, rename --enable-mp3 --enable-mad 2009-03-06 08:30:59 -08:00
Avuton Olrich
721b6f3e61 configure: remove redundant explicit $enableval assignments. 2009-03-06 08:30:59 -08:00
Max Kellermann
5e0acec118 curl: reverse GLIB_CHECK_VERSION()
The GLIB_CHECK_VERSION() macro was used improperly, which broke build
on GLib < 2.14.  Add a "!" for negation.
2009-03-06 15:42:33 +01:00
Max Kellermann
4c3ce9ef1c socket_util: check if IN6_IS_ADDR_V4MAPPED is defined
On some systems, the macro IN6_IS_ADDR_V4MAPPED() is not available.
Don't try to convert IPv6 to their IPV4 equivalents in this case.
2009-03-06 10:09:10 +01:00
Avuton Olrich
38ead091f9 configure: remove duplicate LAME report, unify rest under SHOUTcast header. 2009-03-05 23:25:50 -08:00
Avuton Olrich
7cd9dbd574 configure: make all tests the same, when possible. 2009-03-05 23:17:00 -08:00
Avuton Olrich
cd52258211 configure: Add 'Streaming Support' section to the configure display.
Add 'Streaming Support section to the configure display, clarify
the text and unify with the rest of the display.
2009-03-06 06:51:00 +01:00
Avuton Olrich
6ab53cf62a configure: display the status of lastfm protocol support 2009-03-06 06:50:50 +01:00
Avuton Olrich
f6413d2d5f configure: Fix configure warning presented by lastfm radio.
The configure problem was:
./configure: line 6934: ,: command not found
2009-03-05 16:46:19 -08:00
Max Kellermann
01cf7feac7 pipe: added music_buffer, rewrite music_pipe
Turn the music_pipe into a simple music_chunk queue.  The music_chunk
allocation code is moved to music_buffer, and is now managed with a
linked list instead of a ring buffer.  Two separate music_pipe objects
are used by the decoder for the "current" and the "next" song, which
greatly simplifies the cross-fading code.
2009-03-06 00:42:03 +01:00
Max Kellermann
000b2d4f3a music_pipe: added music_pipe_push()
Added music_pipe_allocate(), music_pipe_push() and
music_pipe_cancel().  Those functions allow the caller (decoder thread
in this case) to do its own chunk management.  The functions
music_pipe_flush() and music_pipe_tag() can now be removed.
2009-03-06 00:42:01 +01:00
Max Kellermann
10be8a8714 playlist_control: fix requeue after seek
The queue update after a seek was wrong: the queued song is cleared by
a successful seek.  This caused queue/cross-fading problems after a
seek.
2009-03-06 00:41:59 +01:00
Max Kellermann
b0fcce65d8 flac: explicitly check for STOP command
After the decoder command was obtained, don't wait until libflac
detects EOF (as a side effect), quit the decoder immediately.  This
check was missing completely.
2009-03-05 18:20:43 +01:00
Max Kellermann
efd606337e flac: check command after flac_process_single() failure
When the MPD core sends the decoder a command while
flac_process_single() is executed, this function fails.  Abort the
decoder only if not seeking.  This fixes a seeking bug.
2009-03-05 18:20:41 +01:00
Max Kellermann
74a2813d78 music_chunk: added music_chunk_write(), music_chunk_expand()
Moved some code from music_pipe_write() and music_pipe_expand().  Only
music_chunk.c should access the music_chunk internals.
2009-03-05 17:37:11 +01:00
Max Kellermann
c655f804a9 music_pipe: moved struct music_chunk to chunk.h 2009-03-03 22:23:25 +01:00
Max Kellermann
1063c1f2e3 alsa: log period and buffer size
Log the real period and buffer size.  This might be useful when
debugging xruns.  Note that the same information is available in
/proc/asound/card*/pcm*p/sub*/hw_params
2009-03-03 22:19:37 +01:00