Commit Graph

519 Commits

Author SHA1 Message Date
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
Max Kellermann 6aa6a9c272 decoder/flac: validate the sample rate when scanning the tag
Don't calculate the song duration when the sample rate is 0 (division
by zero crash).
2011-07-03 14:57:56 +02:00
oblique 8d1c7ca206 ffmpeg: workaround for semantic API change in recent ffmpeg versions 2011-07-03 14:54:56 +02:00
Avuton Olrich 3c4f4793b5 Modify version string to post-release version 0.16.4~git 2011-06-04 07:37:34 -07:00
Avuton Olrich e2950a7e4d mpd version 0.16.3 2011-06-04 07:37:33 -07:00
Max Kellermann e228caaca6 Merge branch 'v0.16.x'
Conflicts:
	src/decoder/ffmpeg_decoder_plugin.c
2011-06-03 16:58:09 +02:00
Max Kellermann 4b4aa64261 directory: allow directories with just playlists
Keep those when scanning for empty directories.  The check in
playlist_vector_is_empty() was missing.
2011-05-09 21:37:43 +02:00
Qball Cow 9ac8f89b1d cue_tag: show CUE track numbers 2011-05-09 21:26:36 +02:00
Max Kellermann c74edd0e33 decoder/ffmpeg: use AVIOContext instead of ByteIOContext 2011-05-09 21:23:58 +02:00
Max Kellermann 98acf3f281 input/ffmpeg: use the new AVIOContext API
URLContext is deprecated.
2011-05-09 21:23:24 +02:00
Max Kellermann 26735390ff playlist_song: fix playlist files in base music directory
g_path_get_dirname() returns "." when there is no directory name in
the given path.  This patch adds a workaround for that.
2011-05-09 18:05:11 +02:00
Max Kellermann 9402b23dd5 playlist_song: fix NULL pointer dereference 2011-05-09 18:03:54 +02:00
Max Kellermann 246db3d565 decoder/ffmpeg: use avcodec_decode_audio3() if available
avcodec_decode_audio3() has been added in libavformat 52.25.0, and the
predecessor avcodec_decode_audio2() has been deprecated.
2011-05-09 09:24:17 +02:00
Anton Khirnov 327d41c00f decoder/ffmpeg: don't use deprecated CODEC_TYPE_AUDIO with new lavc
fixes build with lavc 53.
2011-05-09 08:00:45 +02:00
Anton Khirnov 9d91aa23e6 decoder/ffmpeg: drop support for pre-0.5 ffmpeg
All modern distros ship 0.5, so there's no need to support old and buggy
ffmpeg versions.
2011-04-12 08:14:14 +02:00
Max Kellermann c2ada39fd3 Merge branch 'v0.16.x'
Conflicts:
	NEWS
	configure.ac
2011-04-12 08:11:33 +02:00
Max Kellermann def2fe8805 Merge branch 'v0.15.x' into v0.16.x
Conflicts:
	NEWS
	configure.ac
	src/listen.c
2011-04-12 07:39:01 +02:00
Max Kellermann 532f94a187 audio_parser: fix assertion failure in audio format mask parser
Use audio_format_mask_valid() to verify a mask.
2011-03-23 22:22:51 +01:00
Simon Kagstrom a8f891efcd configure.ac: Enable HAVE_OGG_COMMON when using libtremor
Otherwise OGGs can't be played.
2011-03-23 22:09:58 +01:00
Max Kellermann 0c9fc2f809 Merge commit 'release-0.16.2'
Conflicts:
	Makefile.am
	NEWS
	configure.ac
2011-03-19 09:58:07 +01:00
Avuton Olrich b5fc2419e8 Modify version string to post-release version 0.16.3~git 2011-03-18 17:43:11 -07:00
Avuton Olrich fe588a255b mpd version 0.16.2 2011-03-18 17:43:11 -07:00
Max Kellermann b6303313f0 encoder/vorbis: reset the Ogg stream after flush
Without the ogg_stream_reset() call, the "e_o_s" flag never gets
reset, and libogg writes EOS packets over and over.
2011-03-16 19:16:06 +01:00
Max Kellermann a28449a123 encoder/vorbis: reset the Ogg stream after flush
Without the ogg_stream_reset() call, the "e_o_s" flag never gets
reset, and libogg writes EOS packets over and over.
2011-03-16 19:13:46 +01:00
Max Kellermann 6dcec36621 Merge release 0.15.16 into v0.16.x
Conflicts:
	NEWS
	configure.ac
	src/output/jack_plugin.c
	src/update.c
2011-03-16 18:08:54 +01:00
Hans-Kristian Arntzen 1a954748a0 RoarAudio output plugin 2011-03-16 17:57:47 +01:00
Avuton Olrich 84d0fd39a3 Modify version string to post-release version 0.15.17~git 2011-03-13 20:27:33 -07:00
Avuton Olrich 4d4b7e3de0 mpd version 0.15.16 2011-03-13 20:27:33 -07:00
Ulrich Spörlein e2aea6bce5 output/httpd: include sys/socket.h for AF_UNIX 2011-03-09 19:53:48 +01:00
Ulrich Spörlein 5779146a7f configure.ac: fix bashism in tremor test
This makes FreeBSD detect libogg correctly. The '==' operator is an
undocumented GNU extension to test(1) and cannot be relied upon to
exist and do the right thing. POSIX mandates string comparisons to be
done using "test foo = bar".
2011-03-09 19:50:54 +01:00
Max Kellermann a1d1c2beaa output/oss: disable 24 bit playback on FreeBSD
See code comment.
2011-02-28 00:09:45 +01:00
Max Kellermann ee9c60fad4 output/oss: AFMT_S24_PACKED is little-endian
According to the Solaris dsp manpage, AFMT_S24_PACKED is
little-endian:

 http://download.oracle.com/docs/cd/E19963-01/821-1475/6nmf5baot/index.html

The Minix soundcard.h header says the same.
2011-02-28 00:00:41 +01:00
Max Kellermann 2abad0f479 command: "update" and "rescan" need only "CONTROL" permission
From http://bugs.debian.org/513291

 "In mpd.conf, the "admin" permission covers updating the db and
 killing mpd.

 "Since there are quite some usecases in which the user can upload
 music to the mpd's directory by means of anonymous FTP or so, it is
 desirable that any user may issue a db update, while killing the mpd
 should not be possible.

 "I'd suggest to remove the db update from the admin group and either
 add it to "control" or an own group."
2011-02-27 23:35:00 +01:00
Max Kellermann 1674a4ec82 output/jack: fix crash with mono playback
With mono sound, jack_sample_size is smaller than frame_size (4 vs 2
bytes), and "space/jack_sample_size==0".  That means mpd_jack_play()
will return 0, although no error has occurred.
2011-02-27 23:26:50 +01:00
Max Kellermann 2fb40fe728 playlist_state: add option "restore_paused"
When set, MPD will not auto-start playback on startup; it will be in
"paused" state.
2011-02-23 09:10:23 +01:00
Christopher Brannon 2a1f4539f6 Insure proper initialization of stack-allocated struct.
Version 1.0.0 of the libao library added a new field to the
ao_sample_format struct.  It is a char * named matrix.  When
an ao_sample_format is allocated on the stack, this field contains
garbage.  The proper course is to insure that is initialized to NULL.
NULL indicates that we do not want any mapping.
The struct is now initialized using a static initializer, and this
technique is compatible with all known versions of libao.
2011-02-15 12:16:25 +01:00
Thomas Jansen 144d092637 output/shout: add possibility to set url
Added a new optional parameter for the shout plugin called "url".
2011-02-09 22:42:51 +01:00
Thomas Jansen e776c605ad output/httpd: initialize unflushed_input
This fixes the following valgrind warning occuring on the first call of
httpd_output_read_page:
==20124== Conditional jump or move depends on uninitialised value(s)
==20124==    at 0x425E65: httpd_output_read_page (httpd_output_plugin.c:240)
==20124==    by 0x426087: httpd_output_open (httpd_output_plugin.c:279)
==20124==    by 0x41D862: ao_open (output_plugin.h:206)
==20124==    by 0x41E133: audio_output_task (output_thread.c:590)
2011-02-09 22:41:36 +01:00
Tony Miller 8b2f4fc823 Set fadeout in gme_decoder_plugin. Due to the nature of the gme library,
this needs to be done for the end of songs to be detected.
2011-02-03 00:25:35 +01:00
Max Kellermann 03018611f8 update: log all file permission problems 2011-01-31 09:39:24 +01:00
Max Kellermann f8b09c194f protocol: support client-to-client communication 2011-01-29 10:43:54 +01:00
Max Kellermann c6cbcc2c25 copyright year 2011 2011-01-29 10:13:54 +01:00
Ian Zimmerman 27aa34d4ae input/curl: enable CURLOPT_NETRC
I wanted mpd to play a mp3 stream from a music website.  The stream is
only available to subscribers, which restriction is enforced through
normal http authentication.  However, the URL I get from the website
is not the final URL of the stream, but a generic URL which points to
the real one through a redirect (code 301).  Thus, I cannot predict
the final URL, and so I cannot use the username:password hack to force
the authentication, and mpd (libcurl on mpds behalf) fails to grab the
stream.

libcurl allows the option CURLOPT_NETRC to be set and then the
credentials can be stored in the good old .netrc file (in this case it
would be ~mpd/.netrc, of course).  But mpd doesn't set this option.  I
think it should.
2011-01-29 08:43:30 +01:00
Dustin Puckett 79e0db4ca0 output/raop: new output plugin
Remote Audio Output Protocol (RAOP), for Apple devices.
2011-01-28 21:17:09 +01:00
Max Kellermann 8f99c954ad NEWS: fix 0.16.1 release year 2011-01-28 21:12:17 +01:00
Max Kellermann 5735c9efc1 configure.ac: fix tremor configure test
When the configure options were moved around for 0.16, the order was
changed, and the Tremor check broke.
2011-01-28 12:21:03 +01:00
Yuriy Kaminskiy 9ae3acf2e7 mpg123 decoder: implement seeking 2011-01-21 15:37:08 +01:00
Max Kellermann 2b29ca796e Merge commit 'release-0.16.1'
Conflicts:
	NEWS
2011-01-10 11:47:14 +01:00
Avuton Olrich 44b4b50949 Modify version string to post-release version 0.16.2~git 2011-01-09 18:00:12 -08:00
Avuton Olrich 9ad862d3a6 mpd version 0.16.1 2011-01-09 18:00:12 -08:00
Yuriy Kaminskiy 77d71c4ee6 Makefile.am: resolve modplug vs. libsndfile cflags/headers conflict
A bit of automake magic (see info automake "Per-Object Flags").
Compile-tested.
2011-01-09 18:21:27 +01:00
Max Kellermann 1a2ea4c06c Merge branch 'v0.16.x'
Conflicts:
	NEWS
	configure.ac
2011-01-07 23:52:23 +01:00
Max Kellermann 8c0afd8557 Merge branch 'v0.15.x' into v0.16.x
Conflicts:
	NEWS
	configure.ac
	src/directory.h
2011-01-07 23:50:23 +01:00
Max Kellermann 2a56300f7b player_thread: discard empty chunks while cross-fading
When a music_chunk to be crossfaded consists only of a tag,
cross-fading is not possible, and led to an assertion failure.  This
patch just discards those, as if cross-fading was not enabled.
2011-01-07 23:45:51 +01:00
Max Kellermann 5f06999686 output_thread: fix double lock
During the whole output thread, the audio_output object is locked, and
it is only unlocked while waiting for the GCond and while running a
plugin method.  The error handler in ao_play_chunk() attempted to lock
the object again, which was code from MPD 0.15.x which should have
been removed a long time ago.
2011-01-07 23:08:18 +01:00
Max Kellermann 4c09aeb5a1 player_thread: fix assertion failure due to early seek
Until the decoder plugin has called decoder_initialized(), the player
may not submit seek commands.  This however could occur with a slow
decoder and a CUE file with a virtual song offset.  This patch adds
another check.
2011-01-07 22:52:50 +01:00
Max Kellermann 0022fb100b encoder/lame: explicitly configure the output sample rate
When you don't explicitly set an output sample rate, liblame tries to
guess an output sample rate from the input sample rate.  You would
think that this "guessing" consists of just setting both equal, but
that is not the case.  For 44.1kHz at 96kbit/s, liblame chooses
32kHz.  This patch explicitly configures the output sample rate, to
stop the bad guessing.
2011-01-07 19:37:39 +01:00
Max Kellermann b5645ab29f output/osx: fix up audio format first, then apply it to device
This is a MPD 0.16 regression: when playing a 24 bit file, the switch
to 16 bit was made only partially, after mBytesPerPacket and
mBytesPerFrame had already been applied.

That means mBytesPerFrame referred to 24 bit, and mBitsPerChannel
referred to 16 bits.  Of course, that cannot work.
2011-01-07 17:31:36 +01:00