Commit Graph

5345 Commits

Author SHA1 Message Date
Max Kellermann 9d4b7ab113 decoder_thread: don't fall back to "mad" unless no plugin matches
When all plugins have failed, MPD used to fall back to the "mad"
decoder plugin, to handle those radio streams without a Content-Type
response header.  This however leads to unexpected results (garbage
being played) when the stream isn't really mp3.  Since we care little
about "bad" streams, we shouldn't have hacks which have bad side
effects.

Let's get rid of this hack now!  Only try to "mad" plugin if there was
no match at all (Content-Type, path suffix) and no other plugin has
been tried.
2010-01-17 17:09:10 +01:00
Max Kellermann 8ac776c58b decoder_thread: don't try a plugin twice (MIME type & suffix)
Manage a linked list of plugins which were already tried.
2010-01-17 16:47:04 +01:00
Max Kellermann 2579a2f924 decoder/ffmpeg: added more MIME types
Taken from the ffmpeg sources.
2010-01-17 16:00:14 +01:00
Max Kellermann 006f4be71c fd_util: include ws2tcpip.h for socklen_t 2010-01-17 14:48:52 +01:00
Max Kellermann 163e05f5a0 fd_util: fixed WIN32 versions of pipe()
Use the correct parameter name.
2010-01-17 14:43:15 +01:00
Max Kellermann 02526eda86 text_file: don't strip trailing whitespace
Only delete the newline characters (\n and optionally \r).  This
allows the database file to store file names with trailing whitespace.
2010-01-17 12:52:11 +01:00
Max Kellermann 828a5f552f output/pulse: clear the "mainloop" attribute on error
When enabling the pulse device fails, clear po->mainloop after
pa_threaded_mainloop_free() has finished.  This is important for the
assertions.

Two wrong g_free() calls were also removed.
2010-01-17 12:03:22 +01:00
Max Kellermann a7664b98ba Makefile.am: link test/run_decoder and test/read_tags with timer.c
Needed for the fluidsynth decoder plugin.
2010-01-17 11:21:35 +01:00
Max Kellermann 1b441837f1 decoder/ffmpeg: append file name suffix to virtual stream URL
To allow libavformat to detect the format of the input file, append
the suffix of the input file to the URL of the virtual stream.  This
specifically enables the "shorten" codec, which is supported by
libavformat/raw.c, detected only by the suffix.
2010-01-17 02:36:07 +01:00
Max Kellermann e43bf52cbb configure.ac: disable -Wdeclaration-after-statement
Allow declaration after statement.
2010-01-17 02:36:03 +01:00
Max Kellermann 26841b6058 output/alsa: support packed 24 bit samples 2010-01-17 00:43:24 +01:00
Max Kellermann 1abfcc56af audio_format: support packed 24 bit samples 2010-01-16 23:44:54 +01:00
Max Kellermann da47afe7d1 output/alsa: probe all sample formats in a loop
More code simplification.  Probe all formats, no matter which input
format.
2010-01-16 23:44:52 +01:00
Max Kellermann 96546c1a8a output/alsa: merged code into alsa_output_try_format()
Remove the debug log messages, because they are duplicate (see
ao_open() in output_thread.c).
2010-01-16 23:44:50 +01:00
Max Kellermann 579a8a96ea output/alsa: pass sample_format to get_bitformat() 2010-01-16 23:44:48 +01:00
Max Kellermann 79848e3414 output/alsa: moved code to alsa_output_setup_format() 2010-01-16 23:44:42 +01:00
Max Kellermann 87c861cae3 test/run_convert: implement a GLib log callback
Log to stderr instead of the default stdout.  We need a pristine
stdout for the conversion result.
2010-01-16 23:44:40 +01:00
Max Kellermann 8f326a33ee test/run_convert: use fifo_buffer to adapt to odd sample sizes
Ensure that the pcm_convert() length argument is aligned to the sample
size.
2010-01-16 23:25:58 +01:00
Max Kellermann 8ba08edd0e queue: don't repeat current song in consume mode
Check consume mode in queue_next_order(), because the current song
would be deleted as soon as it's finished; it cannot be played again.
2010-01-16 20:58:24 +01:00
Max Kellermann 90d16af66a decoder_thread: fix CUE track playback
The patch "input/file: don't fall back to parent directory" introduced
a regression: when trying to play a CUE track, decoder_run_song()
tries to open the file as a stream first, but this fails, because the
path is virtual.

This patch fixes decoder_run_song() (instead of reverting the previous
patch) to accept input_stream_open() failures if the song is a local
file.  It passes the responsibility to handle non-existing files to
the decoder's file_decode() method.
2010-01-16 19:20:11 +01:00
Max Kellermann 777bd7c1e1 NEWS: added missing entry 2010-01-16 18:41:34 +01:00
Max Kellermann a942384fbf decoder/flac: support streams without STREAMINFO block 2010-01-06 10:17:16 +01:00
Max Kellermann de0cdee4aa decoder/flac: pass bits_per_sample to flac_sample_format()
Easier to reuse the function.
2010-01-06 09:55:20 +01:00
Max Kellermann 550c9319e9 decoder/flac: moved decoder initialization to _flac_common.c
Invoke decoder_initialized() in the libFLAC metadata callback.  This
merges code from the FLAC and the OggFLAC decoder plugin into the
common library.
2010-01-06 09:50:34 +01:00
Max Kellermann ae9c02b3a8 decoder/flac: remember audio_format, not stream_info 2010-01-06 09:00:32 +01:00
Max Kellermann 6f6d47dd20 decoder/flac: removed CUE sheet support
This feature has been moved to the "flac" playlist plugin.
2010-01-06 08:52:35 +01:00
Max Kellermann 030e61115c playlist: added a FLAC playlist plugin
This playlist plugin handles FLAC files with embedded CUE sheets.
2010-01-06 08:50:52 +01:00
Max Kellermann d6d5caae23 decoder/flac: moved flac_tag_load() to flac_metadata.c
Make this code is reusable.
2010-01-06 08:50:35 +01:00
Max Kellermann 382691179f tag: fixed memmove() size argument in tag_delete_item()
This function has always been broken, but fortunately nobody used it.
2010-01-06 08:48:23 +01:00
Max Kellermann 01c5cb985c playlist_queue: convert absolute paths
Accept absolute paths if they point into the music directory.
2010-01-06 08:00:35 +01:00
Max Kellermann 8a5d2c3c83 playlist_queue: use the "uri" variable earlier
Preparation for the next patch.
2010-01-06 08:00:02 +01:00
Max Kellermann 2f8135ef8b input/rewind: enable the "rewind" wrapper for all non-seekable streams
Don't limit the "rewind" input plugin to CURL streams.
2010-01-04 21:45:32 +01:00
Max Kellermann 9b9abff972 renamed decoder plugin sources
Make it X_decoder_plugin.c.
2010-01-04 21:45:32 +01:00
Max Kellermann c69cc31de0 decoder/mad: fix build error without libid3tag 2010-01-04 21:45:32 +01:00
Max Kellermann 241e94936f replay_gain: moved code to replay_gain_config.c 2010-01-04 21:02:47 +01:00
Max Kellermann 1330274ffc replay_gain: moved code to replay_gain_info.c 2010-01-04 21:02:36 +01:00
Max Kellermann 0e183d3fa1 replay_gain: refactor API, move code to replay_gain_state.c
The replay_gain_state struct holds the precalculated scale factor,
which is removed from struct replay_gain_info.
2010-01-04 20:54:01 +01:00
Max Kellermann cd8f92c928 decoder_api: added function decoder_replay_gain()
This function replaces the replay_gain_info parameter for
decoder_data().  This allows the decoder to announce replay gain
changes, instead of having to pass the same object over and over.
2010-01-04 20:42:49 +01:00
Max Kellermann e58b4f773f replay_gain: added function replay_gain_info_dup() 2010-01-04 20:42:49 +01:00
Max Kellermann 604ca50b65 valgrind.suppressions: added new suppressions 2010-01-04 20:42:49 +01:00
Max Kellermann 537e353546 replay_gain: removed overly verbose debug message
Don't log "ReplayGain is missing".
2010-01-02 23:46:44 +01:00
Max Kellermann f95d7b13da configure.ac: disable -Wdeclaration-after-statement
Allow declaration after statement.
2010-01-02 23:46:42 +01:00
Max Kellermann 915182bcb8 output_all: reset elapsed_time at song border
Another quirk fixed: after the last chunk of a song has been played,
the "elapsed_time" variable is set to the chunk's time stamp.  When
the client receives the PLAYER idle event and asks MPD for the current
time stamp, MPD will return the last time stamp of the previous song
when it hasn't played the first chunk of the current song yet.
2010-01-02 21:16:51 +01:00
Max Kellermann 959f94b06c dbUtils: return empty tag value only if no value was found
This fixes a regression in the patch "return multiple tag values per
song": even when the song has values for the specified tag type, the
empty string gets added to the set, because the "return" was removed.
This patch adds a flag which remembers whether at least one value was
found.
2010-01-02 19:24:31 +01:00
Max Kellermann d3b763a48c input_stream: return allocated input_stream objects
Major API redesign: don't let the caller allocate the input_stream
object.  Let each input plugin allocate its own (derived/extended)
input_stream pointer.  The "data" attribute can now be removed, and
all input plugins simply cast the input_stream pointer to their own
structure (with an "struct input_stream base" as the first attribute).
2010-01-01 17:25:07 +01:00
Max Kellermann 816b6ad4a7 updated valgrind.suppressions
Mostly OpenSSL and GLib one-time allocations.
2010-01-01 17:24:47 +01:00
Max Kellermann 3adfbfe36d configure.ac: expose variables OPENAL_CFLAGS and OPENAL_LIBS
Don't add these to the global MPD_CFLAGS and MPD_LIBS.  This allows
test programs to link without libopenal.
2010-01-01 17:10:10 +01:00
Avuton Olrich 9d3865cb95 Update copyright notices. 2009-12-31 20:58:43 -08:00
Max Kellermann 05cde5810a decoder: switch a bunch of plugins to stream_tag()
This patch changes the following decoder plugins to implement
stream_tag() instead of tag_dup():

 faad, ffmpeg, mad, modplug, mp4ff, mpcdec, oggflac

This simplifies their code, because they do not need to take care of
opening/closing the stream.
2009-12-31 18:32:09 +01:00
Max Kellermann 6b96f5d566 decoder_plugin: added method stream_tag()
This is like tag_dup(), but works with an input_stream object instead
of a file path.
2009-12-31 18:27:48 +01:00