Commit Graph

576 Commits

Author SHA1 Message Date
Max Kellermann c616165f81 Merge branch 'v0.16.x'
Conflicts:
	NEWS
	configure.ac
	src/decoder/ffmpeg_decoder_plugin.c
	test/read_tags.c
2012-02-13 19:15:18 +01:00
Max Kellermann 103832742d decoder/ffmpeg: read the "year" tag
This was disabled when compiled with a new ffmpeg version.  Older
ffmpeg versions used it explicitly, while newer ones may pass it
through from the codec.
2012-02-13 19:05:39 +01:00
Max Kellermann e1e3ce980a decoder_api: check state before emitting initial seek command
This fixes seeking in the vorbis decoder during MPD startup.
2012-02-13 18:27:43 +01:00
Max Kellermann 7855a32579 pcm_buffer: pcm_buffer_get() never returns NULL
This fixes a bug when libsamplerate returns an empty buffer for a very
small input buffer.  The caller thinks this is an error, bug there is
no GError object.
2012-02-13 18:17:05 +01:00
Max Kellermann 01b0d9eb97 db_print: print extra "playlist" object for embedded CUE sheets
This finally enables the new embedded CUE sheet code: when a song file
contains a playlist, it is printed in the "lsinfo" output, so clients
get to know about this.
2012-02-12 18:41:25 +01:00
Max Kellermann abcc225763 cue_parser: new line based CUE sheet parser
To replace libcue, the unmaintained and crashy library.
2012-02-10 00:12:29 +01:00
Max Kellermann b9673fc521 command: add optional range parameter to "load" 2012-02-09 23:55:34 +01:00
Max Kellermann e15b4f40d6 Merge commit 'release-0.16.7'
Conflicts:
	NEWS
	configure.ac
2012-02-05 18:33:58 +01:00
Avuton Olrich 66235fddff Modify version string to post-release version 0.16.8~git 2012-02-04 14:41:59 -08:00
Avuton Olrich f9c5d026f4 mpd version 0.16.7 2012-02-04 14:41:59 -08:00
Max Kellermann c46239af22 Merge branch 'v0.16.x'
Conflicts:
	src/decoder/ffmpeg_decoder_plugin.c
	test/read_tags.c
	test/run_decoder.c
2012-02-04 17:23:53 +01:00
Max Kellermann 5d9876e338 decoder/ffmpeg: use AV_SAMPLE_FMT_* if available
Implements support for libavcodec 0.9, which removes the compatibility
macros SAMPLE_FMT_*
2012-02-03 09:55:25 +01:00
Max Kellermann 378fa5ee6a decoder/ffmpeg: support all MPD tags
Use the tag_item_names table to look up the names of all MPD tags, and
remove the duplicate entries from ffmpeg_tag_maps.
2012-02-03 09:10:48 +01:00
Max Kellermann 26ec62714c mixer/alsa: listen for external volume changes
Use libasound's polling functions, implement a bridge to GSource /
GPollFD and send idle events to clients when an external program
changes the ALSA mixer volume.
2012-01-05 01:52:40 +01:00
Max Kellermann 9937ff8ac0 Merge branch 'v0.16.x'
Conflicts:
	src/decoder/ffmpeg_decoder_plugin.c
	src/input/ffmpeg_input_plugin.c
2012-01-05 00:33:23 +01:00
Max Kellermann abd1949825 decoder/ffmpeg: support libavformat 0.8 2012-01-05 00:17:56 +01:00
Max Kellermann 4e6bc77a70 decoder/ffmpeg: use avcodec_decode_audio4(), support libavcodec 0.8 2012-01-04 22:10:38 +01:00
Max Kellermann 76fcf25898 decoder/ffmpeg: use AVIOContext instead of ByteIOContext 2012-01-04 21:47:47 +01:00
Max Kellermann 56257f072b input/ffmpeg: use the new AVIOContext API
URLContext is deprecated.
2012-01-04 21:47:19 +01:00
Max Kellermann 1ebadf8620 output/osx: implement 32 bit playback 2011-12-24 18:18:42 +01:00
Max Kellermann 43c5058682 Merge branch 'v0.16.x' 2011-12-24 18:15:17 +01:00
Max Kellermann 97b4a6b51f output/osx: clear render buffer when there's not enough data
When we don't have enough data, generate some silence, hoping the
input buffer will fill soon.  Reducing the render buffer size is not
legal.
2011-12-24 17:59:36 +01:00
Max Kellermann f405d27c56 output/osx: remove sleep call from render callback
Blocking inside the render callback is forbidden, and this sleep call
didn't make any sense.
2011-12-24 17:56:10 +01:00
Max Kellermann 99949c8f6f command: new command "seekcur"
For simpler seeking within current song.
2011-12-24 11:20:02 +01:00
Maarten Sebregts 3a9697adf2 Playlist: fix bug in moving after current song
Moving songs using either 'move' or 'moveid' to position -1 (after the
current song) would fail for a song which is just before the current
song.
This patch corrects the check to see if the current song is in the range
to be moved. Since the range is from `start` up to `end` (exclusive) the
check was incorrect, but is now fixed.
2011-12-21 10:29:07 +01:00
Max Kellermann e735abe334 output/openal: use alGetSourcei(AL_BUFFER) to force-unqueue buffers
The implementation of cancel() did not work well: you cannot use
alSourceUnqueueBuffers() to unqueue queued buffers, and our function
openal_unqueue_buffers() left the OpenAL library in a rather undefined
state; nothing was supposed to be queued, but the "filled" variable
was not reset.
2011-12-13 21:59:10 +01:00
Max Kellermann aa4f45b9a5 Merge branch 'v0.16.x'
Conflicts:
	NEWS
	configure.ac
2011-12-13 21:57:44 +01:00
Max Kellermann 96ad5b8444 output/openal: force 16 bit playback, as 8 bit doesn't work
The OpenAL specification says that AL_FORMAT_MONO8 and
AL_FORMAT_STEREO8 expect unsigned 8 bit samples, but MPD uses unsigned
samples.
2011-12-13 21:32:19 +01:00
Max Kellermann 097e5dfbdc timer: fix time unit mixup in timer_delay()
The local variable was already divided by 1000, and the return value
was being divided by 1000 again - doh!  This caused delays in the
httpd output plugin that were too small by three orders of magnitude,
and the buffer was filled too quickly.
2011-12-13 21:02:48 +01:00
Denis Krjuchkov 33232face9 winmm_output_plugin: fail if wrong device specified instead of using fallback.
Silently choosing default is misleading and can cause hours of investigation.
It's better to fail immediately telling user what is wrong with config.
2011-12-13 19:12:33 +01:00
Avuton Olrich 8ca3642429 Modify version string to post-release version 0.16.7~git 2011-12-01 05:44:53 -08:00
Avuton Olrich 1dc000c06a mpd version 0.16.6 2011-12-01 05:44:53 -08:00
Max Kellermann 4f093d5b97 Merge branch 'v0.16.x'
Conflicts:
	Makefile.am
	NEWS
	configure.ac
	src/encoder/flac_encoder.c
	src/log.c
	src/pcm_buffer.c
2011-11-28 11:56:01 +01:00
Max Kellermann e1b032cbad decoder/ffmpeg: work around bogus channel count
Initialize the audio_format before calling avcodec_open(), because
avcodec_open() will fill bogus values.
2011-11-28 11:39:21 +01:00
Max Kellermann 6f365c30eb mapper: check "r" permission on music directory
Yet another common support case.
2011-11-28 09:57:21 +01:00
Max Kellermann 718e180423 mapper: check "x" permission on music directory
This is a common support case, and hopefully, the new error message
will allow the user to understand the error without requiring support.
2011-11-28 09:51:21 +01:00
Max Kellermann cead5e5bd7 mapper: fix the bogus "not a directory" error message
Use stat() instead of g_file_test() to detect other types of errors,
such as "permission denied".
2011-11-28 09:50:44 +01:00
Max Kellermann a727d0bb0b log: print reason for failure 2011-11-28 09:31:43 +01:00
Max Kellermann 0a218ee56a encoder/wave: support packed 24 bit samples
Convert to padded 24 bit samples, instead of falling back to 16 bit.
2011-11-28 09:25:42 +01:00
Max Kellermann 74beefcaf6 encoder/null: use fifo_buffer instead of pcm_buffer
This fixes a buffer corruption bug; pcm_buffer is not designed to be a
persistent buffers, and will discard anything between two consecutive
calls.
2011-11-28 09:23:36 +01:00
Max Kellermann 399a3abefc encoder/wave: use fifo_buffer instead of pcm_buffer
This fixes a buffer corruption bug; pcm_buffer is not designed to be a
persistent buffers, and will discard anything between two consecutive
calls.
2011-11-28 09:23:12 +01:00
Max Kellermann cee5036aca encoder/flac: use fifo_buffer instead of pcm_buffer
This fixes a buffer corruption bug; pcm_buffer is not designed to be a
persistent buffers, and will discard anything between two consecutive
calls.
2011-11-28 09:21:32 +01:00
Max Kellermann ef40e362c9 decoder_api: cancel initial seek when song is not seekable
Fixes assertion failure.
2011-11-27 19:19:43 +01:00
Denis Krjuchkov 6452461c39 path: autodetect filesystem encoding on Win32
WinAPI explicitly declares filesystem encoding.
It can be determined by GetACP().
Use that instead of Glib routine that always "detects" UTF-8 on Win32,
which is incorrect for MPD case.
2011-10-23 16:29:58 +02:00
Max Kellermann 545685bc32 audio_format: basic support for floating point samples
Support for conversion from float to 16, 24 and 32 bit integer
samples.
2011-10-20 02:32:39 +02:00
Max Kellermann c30c46cd5f configure.ac: define WINVER
Ensure that WINVER is defined early enough, so other system headers
won't fall back to their default value.  Specifically, this solves a
build failure (-Werror) with mingw-w64 ("WINVER redefined").
2011-10-13 09:23:32 +02:00
Max Kellermann 04525c0259 event_pipe: fix WIN32 regression
The event pipe is not a socket, and the patch that introduced
g_io_channel_new_socket() to the event pipe library was wrong.
2011-10-13 09:08:37 +02:00
Max Kellermann b9e99575ce Merge commit 'release-0.16.5'
Conflicts:
	NEWS
	configure.ac
2011-10-09 16:32:36 +02:00
Avuton Olrich fa5e06f95d Modify version string to post-release version 0.16.6~git 2011-10-09 04:44:51 -07:00
Avuton Olrich 3041409334 mpd version 0.16.5 2011-10-09 04:44:51 -07:00
Max Kellermann b43bf4dd74 Merge branch 'v0.16.x' 2011-10-08 14:50:44 +02:00
Max Kellermann 5ed0eb51d1 output/openal: auto-fallback to mono if channel count is unsupported
.. instead of failing playback completely.
2011-10-08 14:41:22 +02:00
Max Kellermann fa7fa2a55f playlist_song: allow references to songs outside the musicdir
When we have an absolute path that's not inside the music directory,
allow loading it anyway, if we're in "secure" mode (i.e. the client is
connected via UNIX socket).
2011-10-06 22:57:14 +02:00
Max Kellermann 5c0576ca55 Merge branch 'v0.16.x'
Conflicts:
	configure.ac
	src/player_control.c
	src/player_thread.c
	src/playlist_song.c
2011-10-06 22:45:02 +02:00
Jesús Bravo Álvarez 039b354490 playlist_song: fix absolute path support in playlists
Right now, a playlist with absolute pathnames can only add songs that
are in the same the directory of the playlist or under it.

If uri is an absolute pathname and base_uri is set,
playlist_check_translate_song() will check that base_uri is a prefix
of uri, excluding every other song in the music directory outside
base_uri.

I think in this case base_uri should be completely ignored (and made
NULL) and uri should just be checked against music root directory.
2011-10-06 22:21:24 +02:00
Max Kellermann b2f03e76ff player_thread: add flag "output_open", fixes assertion failure
Previously, the condition "defined(play_audio_format)" was used to see
if an output device has been opened, but if the device had failed on
startup, an assertion failure could occur.  This patch adds a separate
flag.
2011-10-06 21:22:48 +02:00
Max Kellermann 8ea6c113b5 player_control: auto-start playback when seeking is requested
Now that the player thread can handle SEEK commands while not (yet)
playing, we can remove the "pc.state" check from pc_seek().
2011-10-06 00:35:54 +02:00
Max Kellermann 37f026a0a6 player_thread: handle SEEK while not playing 2011-10-06 00:35:53 +02:00
Max Kellermann 4e909f9411 decoder/dsdiff: new decoder plugin
Doesn't seem to work yet, getting just noise from a test file.
Seeking isn't implemented yet.
2011-10-04 21:41:03 +02:00
Steven Blackburn 21851c0673 Add support for streaming to a DLNA client
The Naim Uniti does not appear to support icecast-style streaming of FLAC
music but does support the codec from a DLNA server. This change looks for
"transferMode.dlna.org: Streaming" in the HTTP request header and responds
with something the Uniti (and hopefully other DLNA clients) accepts.

The only difference in the DLNA streaming mode is the reponse header and
that icecast metadata is disabled. If a client request indicates both modes
are supported, the DLNA mode is preferred (as the Uniti says it supports
both but then rejects a FLAC ICY stream).

Note: This change may be specific to Naim equipment (the only device it was
tested on). E.g. the hardcoding of Content-Length which works but is not a
logically correct value. The change should be backwards-compatible, so
only those clients requesting a DLNA stream will see any difference.
2011-09-30 08:53:09 +02:00
Miklos Vajna 83f6498aac Install systemd service file if systemd is available 2011-09-30 08:37:36 +02:00
Max Kellermann 7e219c362c Merge branch 'v0.16.x'
Conflicts:
	src/player_thread.c
2011-09-22 00:27:34 +02:00
Max Kellermann 525a791987 decoder_api: emulate SEEK command for initial seek to CUE track
When playing a CUE track, the player thread waited for the decoder to
become ready, and then sent a SEEK command to the beginning of the CUE
track.  If that is near the start of the song file, and the track is
short enough, the decoder could have finished decoding already at that
point, and seeking fails.

This commit makes this initial seek more robust: instead of letting
the player thread deal with the difficult timings, let the decoder API
emulate a SEEK command, and return it to the decoder plugin, as soon
as the plugin finishes its initialization.
2011-09-22 00:04:48 +02:00
Max Kellermann a3f7947ad2 server_socket: use resolve_host_port() instead of getaddrinfo()
Allow port specification in "bind_to_address" settings.
2011-09-20 21:15:22 +02:00
Max Kellermann 921553d7bb Merge branch 'v0.16.x' 2011-09-20 08:47:06 +02:00
Max Kellermann c476819cb1 fd_util: add function close_socket()
Wrap close(), use closesocket() on WIN32/WinSock.
2011-09-20 08:38:58 +02:00
Max Kellermann 1d8840412f configure.ac: add option --enable-solaris-output
Allow enabling the plugin explicitly without running Solaris, to test
the build.
2011-09-19 09:39:35 +02:00
Max Kellermann df1152ee0f configure.ac: fix solaris result display
Wrong variable name.
2011-09-19 09:39:05 +02:00
Max Kellermann 754f26a97c input_stream: non-blocking I/O
Add GMutex, GCond attributes which will be used by callers to
conditionally wait on the stream.

Remove the (now-useless) plugin method buffer(), wait on GCond
instead.  Lock the input_stream before each method call.  Do the same
with the playlist plugins.
2011-09-16 21:22:13 +02:00
Max Kellermann 87b624f5d5 Merge branch 'v0.16.x' 2011-09-16 07:52:39 +02:00
Max Kellermann 443e96381a configure.ac: disable assertions in the non-debugging build
Add -DNDEBUG to AM_CPPFLAGS.
2011-09-16 07:41:41 +02:00
Max Kellermann f804a739b1 Merge branch 'v0.16.x'
Conflicts:
	NEWS
	configure.ac
2011-09-15 21:48:33 +02:00
Max Kellermann 724a59aaf7 decoder/ffmpeg: don't require key frame for seeking
Use flag AV_TIME_BASE.
2011-09-15 21:32:29 +02:00
Max Kellermann 42d8c2981f decoder/ffmpeg: higher precision timestamps 2011-09-15 21:30:27 +02:00
Max Kellermann 48a84ca23e input/rewind: copy the MIME type only once
Reduce heap usage by reducing the number of malloc() / free() calls.
2011-09-15 20:24:15 +02:00
Max Kellermann 5cf4ce9318 pcm_format: fix 32-to-24 bit conversion (the "silence" bug)
D'oh, we were reading 16 bit integers instead of 32 bit integers!
That caused silence when trying to play a 32 bit input file on a 24
bit sound card (e.g. USB sound chips with 24 bit packed samples).
2011-09-08 23:47:32 +02:00
Max Kellermann c2c4228722 Merge commit 'release-0.16.4'
Conflicts:
	NEWS
	configure.ac
2011-09-02 06:38:01 +02:00
Avuton Olrich 5469941f2b Modify version string to post-release version 0.16.5~git 2011-09-01 17:58:29 -07:00
Avuton Olrich e888c9e827 mpd version 0.16.4 2011-09-01 17:58:28 -07:00
Max Kellermann 3d3bca5338 decoder/oggflac: delete this obsolete plugin
libOggFLAC has been deprecated for 5 years now, and we havn't been
testing it for a long time.  Let's delete it.
2011-09-01 19:29:04 +02:00
Max Kellermann 6a3008d7ff Merge branch 'v0.16.x'
Conflicts:
	configure.ac
	src/output_control.c
2011-09-01 19:19:42 +02:00
Max Kellermann 596f36bb78 output/osx: don't drain the buffer when closing
Eliminate an unnecessary source of deadlocks.
2011-09-01 18:21:46 +02:00
Max Kellermann 13cdc9a9f8 configure.ac: auto-detect libmad without pkg-config
The pkg-config file was added by the Debian package maintainers, and
unfortunately, the rest of the world doesn't have it.
2011-09-01 11:06:08 +02:00
Max Kellermann e635d47912 configure.ac: use MPD_AUTO_PKG to detect avahi
Don't abort the configure script when avahi could not be
auto-detected.  It previously did, because there was no custom "fail"
action for PKG_CHECK_MODULES.
2011-09-01 10:11:23 +02:00
Max Kellermann 8b0b4ff086 output_thread: reimplement CANCEL synchronization
The output thread could hang indefinitely after finishing CANCEL,
because it could have missed the signal while the output was not
unlocked in ao_command_finished().

This patch removes the wait() call after CANCEL, and adds the flag
"allow_play" instead.  While this flag is set, playback is skipped.
With this flag, there will not be any excess wait() call after the
pipe has been cleared.

This patch fixes a bug that causes mpd to discontinue playback after
seeking, due to the race condition described above.
2011-09-01 07:13:21 +02:00
Max Kellermann 11626e48bf input/curl: implement a hard-coded timeout of 10 seconds
Be sure to stop the operation at some point when the server isn't
responding.
2011-08-26 19:28:09 +02:00
Max Kellermann 3b9ffea36f input/soup: new input plugin based on libsoup
To demonstrate the new I/O thread.  libsoup is well-integrated into
the GLib main loop, which made this plugin pretty easy to write.

As a side effect, we have to initialize the I/O thread in all debug
programs that use the input API.
2011-08-24 03:33:49 +02:00
Max Kellermann 5ecb6fecc4 Merge branch 'v0.16.x' 2011-08-24 01:47:10 +02:00
Max Kellermann b3df4dc2c9 output/pulse: fix deadlock when the stream was suspended
Check if the stream is suspended; wake up the main loop when it
becomes suspended.
2011-08-23 23:02:13 +02:00
Max Kellermann 25686e5bce pulse/output: fix deadlock when resuming the stream
Unlock the mainloop in all code paths.
2011-08-23 22:45:47 +02:00
Max Kellermann 8d70f808d9 input/curl: limit the receive buffer size 2011-08-23 20:46:51 +02:00
Max Kellermann b7f435b50e output/httpd: don't warn on client disconnect
This warning should only be logged when we really received something.
When the client disconnects, G_IO_IN is triggered, and the read
returns G_IO_STATUS_EOF.
2011-08-23 18:02:56 +02:00
Max Kellermann 0ea4c970d7 Merge branch 'v0.16.x'
Conflicts:
	src/player_thread.c
	src/playlist_control.c
2011-07-20 21:46:05 +02:00
Max Kellermann 838f7cd210 encoder_plugin: add method pre_tag()
In the "vorbis" plugin, this is a copy of the old flush() method,
while flush() gets a lot of code remove, it just sets the "flush" flag
and nothing else.  It doesn't start a new stream now, which should fix
a few problems in some players.
2011-07-20 20:54:34 +02:00
Max Kellermann b2175629fd update_walk: apply follow_inside_symlinks to absolute symlinks 2011-07-20 14:15:20 +02:00
Max Kellermann 2e28ed8f81 wavpack: obey all decoder commands, stop at CUE track border
It used to ignore the decoder_data() return value.
2011-07-20 12:54:30 +02:00
Max Kellermann d7d717f2ce playlist_control: don't resume playback when seeking to another song while paused
Use a shortcut in playlist_seek_song(), don't call
playlist_play_order() because that would reset the "paused" state.
2011-07-20 11:33:51 +02:00
Max Kellermann d1eeed6a5b output/alsa: fix SIGFPE when alsa announces a period size of 0 2011-07-20 06:54:51 +02:00
Max Kellermann eb2f413cf0 Merge branch 'v0.16.x'
Conflicts:
	NEWS
	configure.ac
2011-07-19 00:24:20 +02:00
Max Kellermann 73f9e17951 NEWS: fix memory leaks 2011-07-18 22:47:51 +02:00