Commit Graph

3758 Commits

Author SHA1 Message Date
Max Kellermann
321eb1077a wildmidi: provide and current total song time
The _WM_Info struct provides all we need, it is obtained by
WildMidi_GetInfo().
2009-02-12 16:47:48 +01:00
Max Kellermann
1492339463 wildmidi: new decoder plugin for MIDI files 2009-02-12 16:43:18 +01:00
Max Kellermann
e56a90f3b3 fluidsynth: new decoder plugin for MIDI files
There are a few problems left in this plugin:

- fluidsynth decodes in real time, while MPD prefers to buffer as
  quickly as possible; as a workaround, this plugin uses a timer
  object to synchronize with real-time playback

- I don't know yet how fluidsynth tells me when the song has ended

- the "soundfont" configuration setting is not yet documented, and it
  will likely change soon (in favor of a per-decoder configuration
  block)
2009-02-12 08:43:26 +01:00
Max Kellermann
de2e13cafe configure.ac: define conditional am__fastdepCXX
When the sidplay plugin is disabled, "./configure" does not look for
the C++ compiler.  This creates an odd situation: automake requires
the am__fastdepCXX conditional, although configure did not generate
it.  Work around this autotools limitation by manually disabling
am__fastdepCXX.
2009-02-11 22:05:46 +01:00
Max Kellermann
1136f6fb7a sidplay: new decoder plugin for playing C64 SID files 2009-02-11 20:31:17 +01:00
Max Kellermann
82fee1390c configure.ac: removed misplaced comma 2009-02-11 19:58:53 +01:00
Max Kellermann
b6b181ca87 decoder_thread: re-enable file decoders
By accident, I committed a debug flag, which disallowed the decoder
thread to play files locally.  Undo this hunk.
2009-02-11 19:58:50 +01:00
Max Kellermann
550b9c3f23 ffmpeg: added TTA support
The ffmpeg library supports the "True Audio Codec".  The entry in
ffmpeg_suffixes was missing.
2009-02-11 18:27:11 +01:00
Max Kellermann
58a5d30826 playlist: don't preserve "current" song after "random" toggle
When MPD is not playing, it may still remember which is the "current"
song.  When you switch to "random" mode, MPD will always start playing
exactly this song.  This defies the goal of "random" mode a little.
Clear the "current" song when MPD is not playing during the "random"
mode switch.
2009-02-11 18:02:50 +01:00
Max Kellermann
9d447dda1d audio: moved code to output_command.c
The output_command library provides a command interface to the audio
outputs.  It assumes the input comes from an untrusted source
(i.e. the client) and verifies all parameters.
2009-02-11 18:02:45 +01:00
Max Kellermann
3bc4224bfd audio_format: added validation functions
In addition to audio_format_valid(), provide functions which validate
only one attribute of an audio_format.  These functions are reused by
audio_format_parse().
2009-02-11 18:00:48 +01:00
Max Kellermann
5090cf6484 audio: replaced parseAudioConfig() with audio_format_parse()
Added audio_format_parse() in a separate library, with a modern
interface: return a GError instead of logging errors.  This allows the
caller to deal with the error.
2009-02-11 18:00:41 +01:00
Qball Cow
5484aaee5f Set boundPort to the current portnumber, so zeroconf announces the right port number 2009-02-11 14:45:04 +01:00
Max Kellermann
b21e8ad4a5 output_all: immediately reopen output on play
When MPD explicitly starts playing, ignore the "REOPEN_AFTER" timeout.
This timeout was useful when MPD attempted to reopen a failed device
over and over, but it confuses users when they explicitly tell MPD to
start playing, while MPD insists to wait for the 10 seconds to pass.
2009-02-10 22:15:42 +01:00
Max Kellermann
e8aee4d992 output_thread: moved code to ao_close()
Merge some duplicate code into one function.
2009-02-10 22:09:07 +01:00
Max Kellermann
a96993f655 output_thread: leave the pause loop on failure
When the pause() method fails, leave the pause loop, because calling
pause() on a closed device is not allowed.
2009-02-10 22:08:05 +01:00
Max Kellermann
bd8ecba449 output_thread: consistently (de)initialize pcm_convert_state
Fix a memory leak: it was not guaranteed that pcm_convert_deinit() was
called for each pcm_convert_init().  This patch always (de)initializes
the pcm_convert library when the audio_output.open flag is flipped.
2009-02-10 22:07:59 +01:00
Max Kellermann
61e3075981 output_api: no CamelCase in struct audio_output
Renamed audio_output struct members.
2009-02-10 21:50:51 +01:00
Max Kellermann
744702f266 shout_mp3: use audio_format_frame_size()
Use audio_format_frame_size() instead of
channels*audio_format_sample_size().
2009-02-10 21:30:28 +01:00
Max Kellermann
b27d9e055b shout: pass void pointer to the encoder
Pass the music chunk as a "const void *" to the encoder, instead of a
"const char *".  Actually, both encoders currently expect 16 bit
samples, passing a 8-bit character is rather pointless.
2009-02-10 21:28:25 +01:00
Max Kellermann
12756c1b55 shout_ogg: moved PCM conversion to a separate function
For simplification, moved the PCM conversion code to
pcm16_to_ogg_buffer().  Work with a int16_t pointer instead of a char
pointer.
2009-02-10 21:25:45 +01:00
Max Kellermann
54982f755f ao: declare AoData.writeSize as size_t
writeSize is a memory size and its type should thus be size_t.  This
allows us to remove two explicit casts.
2009-02-10 21:24:35 +01:00
Max Kellermann
fe142647a5 osx: removed disabled debug messages
Nobody needs these debug messages anymore.
2009-02-10 20:57:21 +01:00
Max Kellermann
86d4cf0dbd output_all: added API documentation 2009-02-10 18:51:59 +01:00
Max Kellermann
facf146cfd output_all: moved code to audio_output_all_finished()
audio_output_all_finished() returns bool, not int.
2009-02-10 18:51:53 +01:00
Max Kellermann
4493a96425 output_all: no CamelCase
Renamed functions and variables.
2009-02-10 18:51:51 +01:00
Max Kellermann
a3a6eefcfe audio: moved code to output_all.c
Moved code which deals with all audio outputs at once into a separate
library.
2009-02-10 18:51:49 +01:00
Max Kellermann
e7505381eb audio: moved protocol code to output_print.c 2009-02-10 18:51:42 +01:00
Max Kellermann
49ff2aceb5 audio: moved state file code to output_state.c 2009-02-10 18:51:39 +01:00
Max Kellermann
f141d90533 audio: removed isCurrentAudioFormat()
This function isn't used anymore.
2009-02-10 18:51:38 +01:00
Max Kellermann
2a388c2aa7 crossfade: don't use isCurrentAudioFormat()
The crossfading code shouldn't depend on the audio output code.  Pass
the current audio format to cross_fade_calc() and let it compare
directly, instead of using isCurrentAudioFormat().
2009-02-10 18:51:29 +01:00
Max Kellermann
34244398d0 playlist: fix assertion when last/current song is deleted
When MPD is stopped, but the last song is still the "current song",
and you delete it, playlist->current is not updated, and becomes an
invalid value.  Fix this by catching "!playlist->playing &&
playlist->current == (int)songOrder".
2009-02-10 17:55:08 +01:00
Max Kellermann
e8787ac4a4 audio: added output enumeration functions
Added audio_output_get(), audio_output_find().
2009-02-10 17:21:19 +01:00
Max Kellermann
3e87033145 audio: added audio_output_config_count()
audio_output_config_count() returns the number of audio outputs in the
configuration file.  It is only used by initAudioDriver().  The public
function audio_output_count() now returns audioOutputArraySize.
2009-02-10 17:21:10 +01:00
Max Kellermann
ff09a41807 output_internal: added missing output_api.h include
output_api.h is required for enum audio_output_command.
2009-02-10 17:21:08 +01:00
Max Kellermann
c2bbf876fb player: added some more assertions
Assertions on pc.command and pc.next_song.
2009-02-10 08:18:28 +01:00
Max Kellermann
799d1c9dc2 player_thread: reset pc.next_song only if queued
When we reset pc.next_song if there is no song queued, this might
cause a race condition: the next song to be played is cleared, while
pc.command was already set.  Clear the "next_song" only if there is a
song queued for the current do_play() invocation.
2009-02-10 08:18:01 +01:00
Max Kellermann
40393ae64f playlist: update queued song after seeking
If a new song is queued before calling playerSeek(), then the player
and the playlist enter an inconsistent state, because the player
discards the playlist's "queued" song in favor of the seeked song.

Call playlist_update_queued_song() after playerSeek().
2009-02-10 00:17:46 +01:00
Max Kellermann
2274434e53 player_thread: reset pc.next_song
After a player command (successful or not), reset pc.next_song,
because the queue is supposed to be empty then.  Otherwise,
playlist.queued and pc.next_song may disagree, which triggers an
assertion failure.
2009-02-10 00:17:34 +01:00
Max Kellermann
710b3275ea queue: update order array after song move
Commit f78cddb4 introduced a regression: after a song was moved, the
order array was not updated (in random mode).  This caused MPD to
think the "current" song has changed when you moved something to the
position of the current song.
2009-02-09 22:47:23 +01:00
Max Kellermann
bee688e99a configure.ac: define HAVE_FFMPEG after all checks
Don't define HAVE_FFMPEG if the ffmpeg libraries were found via
pkg-config, but ffmpeg support was disabled because
avcodec_decode_audio2() is not available.
2009-02-09 22:22:54 +01:00
Vladimir S Eremin
d9ce8d8342 playlist: fixed "next song" check
Check if the "current+1" position is actually valid.
2009-02-09 21:14:38 +01:00
Max Kellermann
e2f22229a6 output_api: include "config.h" without "../"
Including "../config.h" breaks on some systems.
2009-02-09 16:50:25 +01:00
Max Kellermann
1ac328b553 shout: clear buffer before calling the encoder
Always assume the buffer is empty before calling the encoder.  Always
flush the buffer immediately after there has been added something.
This reduces the risk of buffer overruns, because there will never be
a "rest" in the current buffer.
2009-02-09 16:38:25 +01:00
Max Kellermann
7fc25ad567 shout: don't postpone metadata
Don't duplicate the tag received by the send_metadata() method - send
it to the shout server directly.
2009-02-09 16:38:22 +01:00
Max Kellermann
f5c43889c3 shout: use libshout's synchronization
Removed the manual timer synchronization from the shout plugin.
libshout's shout_sync() function does it for us.
2009-02-09 16:38:20 +01:00
Max Kellermann
f6455d5f79 shout: switch to blocking mode
The non-blocking mode of libshout is sparsely documented, and MPD's
implementation had several bugs.  Also removed connect throttling
code, that is done by the MPD core since 0.14.
2009-02-09 16:38:03 +01:00
Max Kellermann
cf94008b27 shout: removed shout_data.tag_to_send
When shout_data.tag!=NULL, there is a "tag to send".  The tag_to_send
flag is redundant.
2009-02-09 16:37:16 +01:00
Max Kellermann
044f2561ce shout: removed shout_data.shout_error
That variable is set in handle_shout_error(), but is never read.
2009-02-09 16:37:12 +01:00
Vladimir S Eremin
cde4cb944e playlist: provide information about "next song"
In random mode, this patch allows clients to see the "next song" in
the queue.
2009-02-09 10:38:03 +01:00