Commit Graph

4886 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen d9353c4fd3 Remove unused headers in Roar plugin.
Should fix build errors for Win32.
2011-03-23 21:59:22 +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
Max Kellermann 1fc571088b command: print playlist load error
Call print_playlist_result() instead of casting the enum implicitly.
2011-03-18 19:45:59 +01:00
Max Kellermann 8d83914f05 output/httpd: include sys/socket.h only when building with libwrap
Fixes build failure on WIN32.
2011-03-18 19:44:12 +01:00
Max Kellermann 0fdcd381bc update_walk: ignore parameter "mode" on WIN32
Fix compiler warning.
2011-03-18 19:43:26 +01:00
Max Kellermann 4f293ecd6f audio_format, output_thread: add more audio_format_valid() assertions 2011-03-16 23:37:41 +01: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
Ulrich Spörlein e2aea6bce5 output/httpd: include sys/socket.h for AF_UNIX 2011-03-09 19:53:48 +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 ce370bee60 output/jack: rename variable sample_size to jack_sample_size 2011-02-25 10:46:44 +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
Max Kellermann b57330cf75 playlist_state: declare local variable as enum 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 948b8f35e6 general: whitespace cleanup
Remove trailing whitespace found by this command:
find -name '*.[ch]' | xargs grep "[[:space:]]$"
2011-02-09 22:42:31 +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 0e69ad32c1 client_idle: export client_idle_add() 2011-01-29 10:43:54 +01:00
Max Kellermann 9b4e14df71 client_idle: add header client_idle.h 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
Yuriy Kaminskiy 9ae3acf2e7 mpg123 decoder: implement seeking 2011-01-21 15:37:08 +01:00
Yuriy Kaminskiy 731ea9b489 mpg123 decoder: report bitrate 2011-01-21 15:37:08 +01:00
Max Kellermann 18b30b5019 decoder_thread: fix assertion failure at song end
Don't finish the current command twice.

This bug was never noticed, but was revealed by a new assertion check.
2011-01-16 17:52:03 +01:00
Andreas Wiese e6c3acaa6f Fix NDEBUG test
<stdbool.h> needs to be included unconditionally from definition of
NDEBUG, since »bool« doesn't get defined otherwise.

Signed-off-by: Andreas Wiese <aw-devel@meterriblecrew.net>
2011-01-14 16:22:25 +01:00
Max Kellermann a1edc199df output_control: document internal functions 2011-01-10 22:16:44 +01:00
Max Kellermann db4aa81528 output_control: move code to ao_lock_command() 2011-01-10 21:54:43 +01:00
Max Kellermann 319ba94a52 output_control: ao_command() calls ao_command_async()
Merge some code.
2011-01-10 21:52:38 +01:00
Max Kellermann 1025f0be91 update_remove: use plain GCond instead of notify
GMutex/GCond guarantee that the access to removed_song is protected.
2011-01-10 21:40:15 +01:00
Max Kellermann 77d3b5e8f1 include cleanup 2011-01-10 21:38:11 +01:00
Max Kellermann a0ad96a787 decoder_control: store GCond object, not a player_control
Remove the decoder dependency on player_control.  All player_control
was needed for is to signal the player thread, and we can do that with
a simple GCond as well.
2011-01-10 21:27:43 +01:00
Max Kellermann 39c5af5dbc decoder_thread: move code to decoder_command_finished_locked() 2011-01-10 21:08:16 +01:00
Max Kellermann acca6a799b decoder_control: remove unused function dc_command_wait()
Only dc_command_wait_locked() is really being used.
2011-01-10 21:08:16 +01:00
Max Kellermann b77e62260a decoder_control: replace dc_init() with dc_new()
dc_new() allocates the object and returns it.  dc_free() frees it
(replaces dc_deinit()).
2011-01-10 20:46:04 +01:00
Max Kellermann b6995ca011 player_control: removed the global variable "pc"
Allocate a player_control object where needed, and pass it around.
Each "client" object is associated with a "player_control" instance.

This prepares multi-player support.
2011-01-10 19:46:23 +01:00
Max Kellermann 715844fd08 dbUtils: don't use directoryAddSongToPlaylist() twice
In findAddInDirectory(), call playlist_append_song() directly, to have
some more type checking.
2011-01-10 19:46:14 +01:00
Max Kellermann 5184008812 input_init: add assertions on completeness of plugins 2011-01-08 18:27:57 +01:00
Max Kellermann cf696ce443 input/cdio_paranoia: add module name
Seems like we forgot to give this module a name...  this can crash MPD
on startup.
2011-01-08 18:27:57 +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 af892e7e80 player_thread: make variables more local 2011-01-07 22:33:10 +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 4f2d67dfb0 output/httpd: define G_LOG_DOMAIN in httpd_client.c 2011-01-07 18:00:12 +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
Ben Kibbey ff4534613a Build fix for Linux. Define _GNU_SOURCE in src/server_socket.c. 2010-12-27 04:36:23 +01:00
Max Kellermann be3b5199b0 stored_playlist: remove database lookups from spl_load()
Don't look up songs in the database, no caller needs this.
2010-12-23 16:25:37 +01:00
Max Kellermann d849a40af6 stored_playlist: ignore empty lines 2010-12-23 16:25:22 +01:00
Max Kellermann 4f48c10312 stored_playlist: use the text_file library to read lines 2010-12-23 16:25:05 +01:00
Max Kellermann 5274fee8a7 playlist_song: add flag "secure"
Optionally allow all local files.

"Insecure" mode is used for printing playlists.
2010-12-23 16:24:00 +01:00
Max Kellermann 5462f34ed0 string_util: add function strchug_fast()
Replace g_strchug() calls with a cheaper implementation.
2010-12-23 16:23:20 +01:00
Max Kellermann 0958ed5844 utils: move string_array_contains() to string_util.c 2010-12-23 16:23:04 +01:00
Max Kellermann e3cba18532 decoder: new "pcm" decoder plugin
Just there to support the "cdio_paranoia" input plugin.
2010-12-22 09:48:48 +01:00
Max Kellermann 9bf7fde49f configure.ac: hook the cdio_paranoia input plugin 2010-12-22 09:44:02 +01:00
Max Kellermann 4783ebc918 input/cdda: rename plugin to "cdio_paranoia" 2010-12-22 09:43:57 +01:00
Max Kellermann 8bda52783b input/cdda: support reading the whole disc 2010-12-22 09:43:53 +01:00
Max Kellermann 07feec7ea6 input/cdda: remove unused function input_cdda_archive_extract_trackno() 2010-12-22 09:43:49 +01:00
Max Kellermann e7471f589a input/cdda: import missing pcm16_to_wave() from the wave encoder 2010-12-22 09:43:47 +01:00
Max Kellermann 24208be5cf input/cdda: implement parse_cdda_uri()
Was missing.
2010-12-22 09:43:41 +01:00
Max Kellermann 8db5f66498 input/cdda: call input_cdda_close() with an input_stream pointer
Another build fix.
2010-12-22 09:43:27 +01:00
Max Kellermann be670bfd1f input/cdda: move code to cdda_detect_drive() 2010-12-22 09:43:20 +01:00
Max Kellermann 19acf090ed input/cdda: remove newlines from error messages 2010-12-22 09:43:16 +01:00
Max Kellermann 2de7f6b457 input/cdda: remove debug code 2010-12-22 09:42:10 +01:00
Max Kellermann a2e265e9a2 input/cdda: some general build failure fixes 2010-12-22 07:44:56 +01:00
Viliam Mateicka 28d7b29d72 input_cdda_plugin: new plugin to handle cdda:// protocol to access CD-DA audio CD's 2010-12-22 07:36:14 +01:00
Max Kellermann 60b4f6b3eb directory: fix warning "comparison between signed and unsigned"
Cast the constant to dev_t, not to unsigned.
2010-12-21 20:21:22 +01:00
Max Kellermann 546232b1c0 zeroconf-bonjour: use g_htons() instead of htons()
Fixes the gcc warning "implicit declaration of function 'htons'".
2010-12-21 20:21:20 +01:00
Max Kellermann fb00e7fddc add void casts to suppress "result unused" warnings (clang) 2010-12-21 08:06:02 +01:00
Alex Viskovatoff 41fdcf328c decoder/mad: work around build failure on Solaris
Rename the "version" struct, because it seems to be a reserved name on
Solaris:

 "src/decoder/mad_decoder_plugin.c", line 550: (enum) tag redeclared: version
 cc: acomp failed for src/decoder/mad_decoder_plugin.c
2010-12-21 07:57:07 +01:00
Greg Ward 9cb4aaf3c2 osx_output: always pass OS X result code to g_set_error().
Should be safe on OS X 10.4 (32-bit), since Apple's OSStatus boils
down to "signed long", and g_set_error() takes gint, which is really
just "int".  Assigning "signed long" to "int" on 32-bit Unix should be
just fine, since both are signed 32-bit ints.

No idea if this is safe on 64-bit OS X.
2010-12-21 07:37:54 +01:00
Greg Ward 80dc602193 osx_output: allow user to specify other audio devices.
Add new config parameter 'device' to audio_output type "osx":
- if not supplied or set to "default", open default device
- if set to "system", open system device
- otherwise 'device' should be an audio device name: mpd will find and
  open the specified audio device, falling back to the default
  device if it's not found
2010-12-21 07:36:28 +01:00
Alex Viskovatoff 144ad7992e output/solaris: add missing parameter to open_cloexec() call 2010-12-21 07:31:08 +01:00
Alex Viskovatoff a0dd1a1b8b audio_check: fix parameter in prototype 2010-12-21 07:29:58 +01:00
Max Kellermann 748a8a6f42 tag_id3: support multiple values
Loop over all frames with a specific id, and import all of them - not
just the first one (index 0).
2010-12-07 18:05:44 +01:00
Anton Khirnov cb9965bab5 command: don't error when sticker list is run on song with no stickers
this is inconsistent with other commands (e.g. find) and seems wrong --
a song with no stickers attached is a perfectly valid state and an empty
list of stickers is also perfectly valid.
2010-12-07 17:32:52 +01:00
Max Kellermann 429ed24c99 tag_ape: support multiple values
One APE tag may contain more than one value, separated by null bytes.
2010-11-24 08:59:04 +01:00
Max Kellermann 1ab46472ab decoder_thread: load APE replay gain from music files 2010-11-18 23:02:30 +01:00
Max Kellermann f6bbe1332f replay_gain_ape: parse replay gain from APE tags
Based on the APE reader.
2010-11-18 22:26:06 +01:00
Max Kellermann 11613347be tag_ape: move code to ape.c
Generic library for scanning APE tags.  Eliminated one "goto"!
2010-11-18 21:44:24 +01:00
Max Kellermann 8f46f1520c timer: fix integer overflow in timer_delay()
Fixes a regression: for output_plugin.delay(), we added a method to
the timer class which returns the delay in milliseconds.  This fails
to detect negative values, because the unsigned integer is divided by
1000, and then casted to signed.
2010-11-18 21:29:03 +01:00
Max Kellermann 46ab8d18e2 playlist_song: calculate duration of last CUE track 2010-11-08 20:16:26 +01:00
Max Kellermann f384f8da93 Merge release 0.15.15 from branch 'v0.15.x'
Conflicts:
	NEWS
	configure.ac
2010-11-08 18:50:22 +01:00
Max Kellermann cc1debc948 output/shout: artist comes first in stream title
After popular demand, I've switched the order of "artist" and "title"
in the stream title.  There is no standard, and there is no reliable
way to parse those from the stream title.
2010-11-08 18:46:14 +01:00
Max Kellermann 5a3aa1262a update_walk: explicitly check for permission problems
Call access() and print an extra error message when EACCES is
returned.  Hopefully this will reduce the number of support requests
due to wrong file permissions.
2010-11-08 18:24:19 +01:00
Max Kellermann ad52eb236d input/rewind: fix assertion failure
The assertion added in MPD 0.15.14 was too much, it failed when the
MIME type of a stream was NULL.
2010-11-08 10:37:09 +01:00
Max Kellermann 4478b3ef74 Merge release 0.15.14 from branch 'v0.15.x'
Conflicts:
	NEWS
	configure.ac
	src/decoder_control.c
	src/decoder_control.h
	src/input/rewind_input_plugin.c
	src/output_control.c
	src/output_thread.c
	src/player_thread.c
2010-11-07 15:30:18 +01:00
Max Kellermann 83ec0e5552 player_thread: fix assertion failure due to wrong music pipe on seek
When one song is played twice, and the decoder is working on the
second "instance", but the first should be seeked, the check in
player_seek_decoder() may assume that it can reuse the decoder without
exchanging pipes.  The last thing was the mistake: the pipe pointer
was different, which led to an assertion failure.  This patch adds
another check which exchanges the player pipe.
2010-11-05 19:24:42 +01:00
Max Kellermann cc261872c2 decoder_control: pass music_pipe to dc_start()
More abstraction for decoder_control.pipe.
2010-11-05 19:18:44 +01:00
Max Kellermann 5223261f19 player_thread: add helper function player_dc_at_next_song()
Some abstraction for decoder_control.pipe access.
2010-11-05 19:08:59 +01:00
Max Kellermann c594afeee7 pipe: add helper function music_pipe_empty() 2010-11-05 18:40:23 +01:00
Max Kellermann 32d10eedbd input/rewind: remove redundant NULL check before g_free() call 2010-11-05 18:40:14 +01:00
Max Kellermann dfd98eede7 input/rewind: add two assertions 2010-11-05 18:40:07 +01:00
Max Kellermann a728d7a026 input/rewind: fix double free bug
Duplicate the "mime" attribute of the inner input_stream object,
instead of copying the pointer.
2010-11-05 18:39:40 +01:00
Max Kellermann 5a26320680 output/alsa: dump buffer and period limits 2010-11-05 10:35:46 +01:00
Max Kellermann 90dc880e67 output/httpd: implement delay() 2010-11-05 09:49:22 +01:00
Max Kellermann e11ff967d0 output/shout: implement delay()
This makes the plugin more responsive to control commands, because it
will listen to control events while waiting.
2010-11-05 09:49:20 +01:00
Max Kellermann 2dc6ed7b3a output_plugin: add method delay()
This method is used to reduce the delay of commands issued to the
shout plugin.
2010-11-05 09:47:43 +01:00
Max Kellermann ad430c6617 timer: add function timer_delay() 2010-11-05 09:39:56 +01:00
Max Kellermann e8d8bd4c0d decoder/{mp4ff,ffmpeg}: add extension ".m4b" (audio book)
Same as ".m4a".
2010-11-05 02:01:35 +01:00
Max Kellermann 8d5fa754e8 output_thread: fix assertion failure due to race condition in OPEN
Change the assertion on "fail_timer==NULL" in OPEN to a runtime check.
This assertion crashed when the output thread failed while the player
thread was calling audio_output_open().
2010-11-04 23:44:23 +01:00
Max Kellermann 2ee047a1dd output_internal: protect attribute "fail_timer" with mutex 2010-11-04 23:40:43 +01:00
Max Kellermann 9562f66741 output_control: lock object in audio_output_open()
Protect the attributes "open" and "fail_timer".
2010-11-04 23:28:18 +01:00
Max Kellermann 21223154aa output_control: lock object in audio_output_close()
Protect the attributes "open" and "fail_timer".
2010-11-04 21:51:02 +01:00
Mantas Mikulenas ec48b5ea3a server_socket: remove AI_ADDRCONFIG
When you pass the flag AI_ADDRCONFIG to getaddrinfo(), it does not
consider address families on the loopback device.  When run on a
machine without an external network card, just with "lo", it was
unable to look up any address.
2010-11-04 20:17:45 +01:00
Max Kellermann 754015544f output/ffado: transfer_playback_buffers() returns a boolean
libffado documentation says this function returns -1 on error, but
that is a lie - it returns a boolean value, and "false" means error.
2010-11-04 20:08:04 +01:00
Max Kellermann 3f89f77429 decoder/ffmpeg: check AVCodecContext.sample_fmt value
.. instead of av_get_bits_per_sample_format().  The SampleFormat enum
value is authoritative.
2010-11-04 20:04:15 +01:00
Denis Krjuchkov 9dee419b7c winmm_output: handle empty string case when parsing device id 2010-11-04 11:09:50 +05:00
Denis Krjuchkov 7612bf1bfa winmm_output: added "device" configuration option
Device can be specified either by magic index (starting with 0)
or by device name.
2010-11-04 00:51:18 +05:00
Denis Krjuchkov ad56e10e5b winmm_output: improved test_default_device
If no device is available test_default_device returns false.
2010-11-03 23:31:49 +05:00
Max Kellermann 75f4772ba2 output: new output plugin "ffado"
Using libffado, to play on firewire audio devices.

Warning: this plugin was not tested successfully.  I just couldn't
keep libffado2 from crashing.  Use at your own risk.

For details, see my Debian bug reports:

  http://bugs.debian.org/601657
  http://bugs.debian.org/601659
2010-10-27 21:25:41 +02:00
Alder Hornbridge fe1b626f76 decoder/sidplay: play mus, str, prg, x00 files 2010-10-27 21:18:43 +02:00
Alder Hornbridge 4e94516912 decoder/sidplay: play monaural SID tunes in mono 2010-10-27 21:16:24 +02:00
Tony Miller dadb6747ad Container support for gme decoder. 2010-10-14 17:11:59 +02:00
Max Kellermann 188e1b440e playlist/rss: new playlist plugin for RSS feeds 2010-10-11 20:33:41 +02:00
Max Kellermann a57f9e712d Merge release 0.15.13 from branch 'v0.15.x'
Conflicts:
	NEWS
	configure.ac
	src/input/rewind_input_plugin.c
	src/output/httpd_output_plugin.c
2010-10-11 20:33:17 +02:00
Denis Krjuchkov e6fc88a758 mixer: winmm_mixer implemented 2010-10-09 02:45:08 +06:00
Denis Krjuchkov 20004b7ee0 win32_output: renamed win32 output plugin to winmm
Win32 has many audio APIs. New name is slightly more correct.
2010-10-08 23:55:14 +06:00
Max Kellermann 84e037631d output/httpd: use the new server_socket library 2010-10-05 21:18:54 +02:00
Max Kellermann 18e3d0b504 listen: move generic code to server_socket.c 2010-10-05 21:18:54 +02:00
Max Kellermann 04c4398bfc output/httpd: don't close socket in open() failure
This cleanup call is obsolete, since we moved the binding code to
enable()/disable().
2010-10-05 21:18:54 +02:00
Max Kellermann 39e42394bd output_all: disable outputs on shutdown
Call output_plugin.disable() before output_plugin.finish().  This
ensures that all outputs are properly cleaned up, to make valgrind
happy.
2010-10-05 21:18:54 +02:00
Max Kellermann 5923cfcde3 output/httpd: MIME type audio/ogg for Ogg Vorbis
RFC 5334 10.3 defines the MIME type "audio/ogg".  We could use
"application/ogg" as well, but we know for sure that we only emit
audio data.
2010-10-03 16:22:03 +02:00
Denis Krjuchkov e10b872fc3 main_win: replaced g_error usages with MPD_ERROR 2010-09-28 22:38:57 +06:00
Denis Krjuchkov 2b78358af5 mpd_error: more correct MPD_ERROR implementation
Original implementation does not handle
	if (...)
		MPD_ERROR("die");
	else
		...
case well. This change fixes handling of such cases.
2010-09-28 18:12:14 +02:00
Thomas Jansen e3f4c7b91c input/rewind: enable for MMS 2010-09-28 12:56:47 +02:00
Andrew Morgan a59ab3e2ee playlist: make single mode 'sticky' 2010-09-28 12:52:52 +02:00
Thomas Jansen 28bcb8bdf5 eliminate g_error() usage
Replaced all occurrences of g_error() with MPD_ERROR() located in a new header
file 'mpd_error.h'. This macro uses g_critical() to print the error message
and then exits gracefully in contrast to g_error() which would internally call
abort() to produce a core dump.

The macro name is distinctive and allows to find all places with dubious error
handling. The long-term goal is to get rid of MPD_ERROR() altogether. To
facilitate the eventual removal of this macro it was added in a new header
file rather than to an existing header file.

This fixes #2995 and #3007.
2010-09-25 15:00:43 +02:00
Thomas Jansen 9af9fd1400 output/httpd: bind_to_address support (including IPv6)
Added support for a new optional configuration setting for the httpd output
named "bind_to_address". Setting it to a specific IP address (v4 or v6) will
cause the httpd output to bind to that address exclusively. Supporting
multiple addresses in parallel is future work.

This implements the feature requests #2998 and #2646.
2010-09-25 15:00:43 +02:00
Thomas Jansen 0c80bd5fc0 conf: Whitespace cosmetics 2010-09-25 15:00:43 +02:00
Max Kellermann a14cd97f56 playlist: fix "queued" check in playlist_sync()
The check was meant to fix an assertion failure, but it was the wrong
way around.  This broke cross-fading most of the time.
2010-09-23 23:29:36 +02:00
Max Kellermann 0955f33a86 decoder/mp4ff: support more variations of "album artist"
According to the mantis bug report 2847, there are several possible
variations of the "album artist" tag:

- "album artist"
- "album_artist"
- "albumartist"

This patch adds support for the latter two.
2010-09-23 21:19:41 +02:00
Max Kellermann a016fb4048 listen: fix "unused parameter" warning on WIN32 2010-09-23 20:51:23 +02:00
Denis Krjuchkov e8ebb1af91 main: Add Windows Service support
I've added PIPE_EVENT_SHUTDOWN because calling g_main_loop_quit() do not work when called from another thread.
Main thread was sleeping in g_poll() so I needed some way to wake it up.

By some strange reason call close(event_pipe[0]) in event_pipe_deinit() hangs.
In current implementation that code never reached so that was not a problem :-)
I've added a conditional to leave event_pipe[0] open on Win32.
2010-09-23 20:42:33 +02:00
Thomas Jansen 9fa3d7c4fa playlist_state: Fix the "state" line in the output
An '\n' was erroneously inserted in the line containing the state, e.g.
"state: \nplay" instead of "state: play".

Fix for bug #2992.
2010-09-23 20:41:23 +02:00
Thomas Jansen 54294366d5 rewind_input_plugin: Update MIME not only once
The assumption that MIME type is set only once is not valid with CURL,
as URL redirections may update the MIME type.

This fixes bug #3044.
2010-09-23 20:39:13 +02:00
Max Kellermann 9423b456a1 zeroconf-bonjour: use g_htons() instead of htons()
htons() is not available if netinet/in.h is not included.
2010-09-23 09:01:37 +02:00
Max Kellermann 64209749fb directory: cast DEVICE_INARCHIVE, DEVICE_CONTAINER to dev_t
Fix gcc warning.
2010-09-23 09:01:25 +02:00
Max Kellermann 586b7601c6 playlist_database: initialize pm.mtime 2010-09-23 09:01:23 +02:00
Max Kellermann 4425989898 fd_util: work around aliasing warning in recvmsg_cloexec() 2010-09-23 09:01:20 +02:00
Max Kellermann 5b996ab880 output/httpd: access sockaddr_storage object directly
Work around aliasing warning.
2010-09-23 09:01:17 +02:00
Max Kellermann 635cfbae13 decoder_control: use g_free() to manage mixramp allocations
Be consistent with the rest of MPD, and don't use the non-portable
header "malloc.h".
2010-09-23 08:49:21 +02:00
Qball Cow 4a7abc9d44 Correctly terminate stream_title.
This caused random data to be send via icy-server if the played
song had no tags.
2010-09-08 13:19:59 +02:00
Max Kellermann 589bb54111 input/curl: fix version check for curl_multi_timeout()
According to the CURL web site, curl_multi_timeout() was added in
version 7.15.4:

 http://curl.haxx.se/libcurl/c/curl_multi_timeout.html
2010-09-07 21:40:56 +02:00
Max Kellermann d953225531 update_walk: update existing playlist entry
Fixes duplicate playlist entries.
2010-09-07 20:22:05 +02:00
Max Kellermann 663815ead8 playlist_vector: update_or_add() returns bool
False if the vector was not modified.
2010-09-07 20:21:19 +02:00
Max Kellermann 917434269c output/httpd: implement "pause"
Send silence to all connected clients while paused, to avoid
connection interruption.
2010-08-31 06:50:14 +02:00
Max Kellermann a77506ae21 output/httpd: forced flush after 32 kB of input data
Avoid buffer underruns on the streaming client, if the encoder is "too
efficient" (e.g. when encoding silence while paused).
2010-08-31 06:49:06 +02:00
Johan Kiviniemi ed5d297301 ReplayGain filter: allow gain > 100 %
The ReplayGain filter clamped the gain to max. 100 % even if the
algorithm determined the signal needed a boost. That would result in any
such tracks being played with too low volume, effectively defeating the
purpose of the filter.
2010-08-23 16:34:11 +03:00
Max Kellermann 64dacd175a output_thread: fix race condition after CANCEL command
Clear the notification before finishing the CANCEL command, so the
notify_wait() after that will always wait for the right notification,
sent by audio_output_all_cancel().
2010-08-19 11:05:24 +02:00
Max Kellermann 625e4755d1 notify: add function notify_clear() 2010-08-19 11:03:53 +02:00
Max Kellermann 68c02fc95a fd_util: add function dup_cloexec()
Unfortunately, there's no "optimized" implementation here.  We can't
use Linux's proprietary system call dup3(), because it would require
us to specify the new descriptor.
2010-08-03 18:03:55 +02:00
Max Kellermann d18c1b1a0a fd_util: add function recvmsg_cloexec() 2010-08-03 17:51:35 +02:00
Max Kellermann c980fc653d fd_util: add function socketpair_cloexec() 2010-08-03 17:51:35 +02:00
Max Kellermann 013ebb638a playlist_song: fix memory leak
Free the temporary path string in apply_song_metadata().
2010-07-25 13:35:59 +02:00
Max Kellermann bedb82bf4d directory: free playlist vector in directory_free() 2010-07-25 13:31:39 +02:00
Max Kellermann cbb1ab58cd queue_save: save tags and range of non-database songs
Use the functions song_save() and song_load() to use the same format
as in the database file for those songs which need the tags.
2010-07-25 13:28:54 +02:00
Max Kellermann b01235e330 song_save: save start_ms and end_ms
While this is not useful for the database, it may become useful for
reusing this code for the state file.
2010-07-25 13:28:52 +02:00
Max Kellermann 8341a9f7b2 queue_save: simplify get_song()
Don't try db_get_song() if the URI has a scheme.
2010-07-25 13:28:48 +02:00
Max Kellermann b233c145fa {queue,song}_print: print relative paths if possible
If a song with an absolute path points inside the music directory,
print only the relative part.  This happens when partial songs from a
playlist file were loaded.
2010-07-25 13:28:39 +02:00
Max Kellermann 9de5bb9e23 queue_print: hide HTTP password in the "playlist" command
I've already changed the "playlistinfo" command to hide HTTP
passwords, but forgot to do the same for the simpler "playlist"
command.  This patch changes queue_print_uris() to use the code from
song_print_uri().
2010-07-25 13:24:19 +02:00
Max Kellermann 0c5305c51f queue_save: move code to queue_save_song() 2010-07-25 12:43:54 +02:00
Max Kellermann 63c9a20f96 queue_save: queue_load_song() returns void
The only caller doesn't use its return value, and the value isn't
useful anyway.
2010-07-25 12:43:18 +02:00
Max Kellermann b40c0811f4 song_save: song_load() returns NULL instead of false 2010-07-25 12:23:52 +02:00
Max Kellermann 838790fc2d state_file: use the text_file library
Don't use a large stack buffer.
2010-07-25 12:01:59 +02:00
Max Kellermann 1ff2d5b689 playlist_state: simplify printf() calls
Let the C compiler concatenate string constants.
2010-07-25 12:01:59 +02:00
Max Kellermann e4b7a113fd database, ...: remove EINTR checks after stdio calls
MPD doesn't have child processes anymore, and thus we're not expecting
to receive SIGCHLD very often.  Since hard disk access isn't
interrupted by signals anyway, we don't need those excessive checks.
2010-07-25 12:01:59 +02:00
Max Kellermann 7820ebb82e directory_save: duplicate the playlist name
The function playlist_metadata_load() will overwrite the input buffer
before using the "name" parameter; since "name" points to the same
buffer, we'll get a corrupted string.
2010-07-25 12:01:59 +02:00
Rasi 31ab0b3df1 Added album tag support for libgme decoder 2010-07-23 23:13:03 +02:00
Max Kellermann e598922133 update: store playlist files in database
Don't open the music directory for each "lsinfo" call.  Get the list
of playlist files from the memory database.
2010-07-21 09:26:50 +02:00
Max Kellermann e21ad70f3f song_save: pass const songvec to songvec_save() 2010-07-21 09:26:50 +02:00
Max Kellermann a81cb932c2 song_save: include cleanup 2010-07-21 09:26:46 +02:00
Max Kellermann 3d66a4fee8 database: remove outdated comment 2010-07-21 09:20:14 +02:00
Max Kellermann dea5601e79 tag_rva2: move code to rva2_apply_data() 2010-07-20 23:05:24 +02:00
Max Kellermann 43a840552f tag_rva2: add struct rva2_data
.. and several accessor inline functions, to simplify the calling
code.
2010-07-20 23:05:06 +02:00
Max Kellermann 2f16f8e9f7 tag_rva2: name the CHANNEL_* enum 2010-07-20 23:05:01 +02:00
Max Kellermann 4364b30c42 decoder/mad: move RVA2 code to tag_rva2.c 2010-07-20 23:03:54 +02:00
Max Kellermann c0da938d4f Merge release 0.15.12 from branch 'v0.15.x'
Conflicts:
	NEWS
	configure.ac
2010-07-20 23:03:06 +02:00
Max Kellermann fb19aa355e replay_gain_info: fix indentation 2010-07-20 22:59:04 +02:00
Max Kellermann 1f976d6e54 input/curl: remove assertion after curl_multi_fdset()
Some users reported that MPD crashes when using a new CURL version
with the threaded DNS resolver enabled.  It seems that
curl_multi_fdset() returns no file descriptor when the DNS resolver
runs in another thread, so MPD does not have any event to wait for.

On the CURL mailing list, somebody suggested to sleep for a fixed
amount of time.  This is not an elegant solution, because daemons
should never have to sleep without waiting for an event.  I hope the
CURL developers will review the API and remove the threaded DNS
resolver.

Meanwhile, I'm removing the assertion in question, to allow those
unfortunate users running the latest CURL version to continue using
MPD.
2010-07-20 22:55:13 +02:00
Max Kellermann a4908dca42 input/curl: query timeout from CURL
Use curl_multi_timeout() to determine the select() timeout, instead of
hard-coding one second.
2010-07-20 22:37:34 +02:00
Max Kellermann 8b055c3127 tag_rva2: set "gain", not "peak"
RVA2 tags only store the "gain" value, there is no "peak" attribute.
2010-07-20 22:32:55 +02:00
Max Kellermann 172182b18f decoder/mad: parse_rva2() returns bool 2010-07-20 18:27:11 +02:00
Max Kellermann 898a13f196 decoder/wildmidi: support version 0.2.3
In libwildmidi 0.2.3, the function WildMidi_SampledSeek() was removed,
without changing the SO name.  This patch adds an autoconf check for
that function.  Fall back to WildMidi_FastSeek() if
WildMidi_SampledSeek() is not available anymore.
2010-07-20 18:23:56 +02:00
Max Kellermann 2bc5161e95 Merge release 0.15.11 from branch 'v0.15.x
Conflicts:
	NEWS
	configure.ac
	src/decoder/ffmpeg_decoder_plugin.c
	src/decoder/mikmod_decoder_plugin.c
	src/decoder/mp4ff_decoder_plugin.c
	src/decoder/vorbis_decoder_plugin.c
	src/directory_print.c
	src/playlist_control.c
	src/tag_ape.c
2010-07-19 23:49:15 +02:00
Max Kellermann e2e8d0d2f3 decoder/ffmpeg: fix libavformat 0.6 by using av_open_input_stream()
libavformat 0.6 does not pass the original URI pointer to the "open"
method, which leads to a crash because MPD was using a dirty hack to
pass a pointer to that method.

This patch switches to av_open_input_stream() with a custom
ByteIOContext class, instead of doing the URI string hack with
av_open_input_file().

Loosely based on a patch from Jasper St. Pierre.
2010-07-19 23:03:06 +02:00
Max Kellermann b2e3c0757b decoder/ffmpeg: manual format probing
Use the libavformat function av_probe_input_format() to probe the
AVInputFormat, instead of letting av_open_input_file() do it
implicitly.  We will switch to av_open_input_stream() very soon, which
does not have the probing code.

Loosely based on a patch from Jasper St. Pierre.
2010-07-19 22:59:59 +02:00
Anton Khirnov 0fc0196dba ffmpeg: read the audio stream metadata in addition to global
in some formats, e.g. vorbis, the metadata is stored per-stream.
2010-07-12 11:36:55 +02:00
Anton Khirnov 1492324c76 ffmpeg: factor tag_type <-> ffmpeg tag name maps into a table. 2010-07-12 11:36:55 +02:00
Max Kellermann 49bc317fb8 decoder/ffmpeg: fix libavformat 0.6 by using av_open_input_stream()
libavformat 0.6 does not pass the original URI pointer to the "open"
method, which leads to a crash because MPD was using a dirty hack to
pass a pointer to that method.

This patch switches to av_open_input_stream() with a custom
ByteIOContext class, instead of doing the URI string hack with
av_open_input_file().

Loosely based on a patch from Jasper St. Pierre.
2010-06-30 23:41:32 +02:00
Max Kellermann 375a09d6f6 decoder/ffmpeg: manual format probing
Use the libavformat function av_probe_input_format() to probe the
AVInputFormat, instead of letting av_open_input_file() do it
implicitly.  We will switch to av_open_input_stream() very soon, which
does not have the probing code.

Loosely based on a patch from Jasper St. Pierre.
2010-06-30 23:40:31 +02:00
Max Kellermann 0265c34bed decoder/ffmpeg: free URI, fix memory leak
Free the string allocated by decoder_get_uri().
2010-06-30 23:40:04 +02:00
Max Kellermann a1882f48be decoder/vorbis: handle uri==NULL
This fixes a theoretical crash, which has never occurred in practice.
2010-06-30 23:38:49 +02:00
Anton Khirnov c3569814bd ffmpeg: read more metadata. 2010-06-30 23:18:45 +02:00
Max Kellermann 814daac5ba decoder/ffmpeg: free AVFormatContext on error
Fix a memory leak in some code paths.
2010-06-30 23:14:43 +02:00
Max Kellermann 768be22f7c pcm_buffer: make the buffer pointer "void" 2010-06-30 21:55:46 +02:00
Max Kellermann ec89ce5a8a decoder/mp4ff: support tag "album artist"
We already supported "albumartist", but it seems some folks also use
"album artist" (with a space).
2010-06-30 21:55:03 +02:00
Andreas Vögele 34415bf0b6 Make get_remote_uid() work on BSD
I've attached a patch that will make file URIs work on operating systems
that provide the getpeereid() function call to check the user ID of the
peer connected to a UNIX domain socket.
2010-06-30 21:42:01 +02:00
Max Kellermann 0a0c78674f playlist: emit IDLE_OPTIONS when resetting single mode 2010-06-30 21:40:33 +02:00
Max Kellermann 1bffdabe41 directory_print: return void
There is no useful return value here.
2010-06-30 21:39:34 +02:00
Max Kellermann 77e6810c14 decoder/mikmod: fix memory leak
The return value of Player_LoadTitle() is allocated with malloc(), and
must be freed by the caller.
2010-06-30 19:37:36 +00:00
Max Kellermann 5ebe33653c decoder/mp4ff: remove duplicate entries in the tag name table
Reuse the function tag_name_parse_i().
2010-06-30 21:36:15 +02:00
Max Kellermann 8e3eace289 decoder/mp4ff: moved code to mp4ff_tag_name_parse() 2010-06-30 21:36:00 +02:00
Max Kellermann 284659034d tag_ape: remove duplicate entries in the tag name table
Reuse the function tag_name_parse_i().
2010-06-30 21:33:19 +02:00
Max Kellermann 9550c87327 tag: added function tag_name_parse()
Convert a string into a tag_type enum.
2010-06-30 21:31:45 +02:00
Max Kellermann e223e8a5b5 tag_ape: move code to tag_ape_name_parse() 2010-06-30 21:30:21 +02:00
Max Kellermann 4d6d372a5b decoder/vorbis: use single global ov_callbacks constant
Initialize the ov_callbacks struct at compile time.
2010-06-30 19:24:41 +00:00
Max Kellermann 0aeec90590 decoder/mp4ff: support tags "albumartist", "band"
I'm not sure if mapping "band" to TAG_PERFORMER is correct, but it
might be better than nothing.
2010-06-30 21:22:13 +02:00
Max Kellermann cfcd84655c decoder/mp4ff: use tag_table.h to parse tag names
Convert if/else/else/... to a loop.
2010-06-30 21:19:30 +02:00
Max Kellermann 5092eaf1cc tag_ape: move table lookup to tag_table.h
Allow code sharing.
2010-06-30 21:18:27 +02:00
Max Kellermann 9328558fc7 tag_ape: support album artist
I took this tag name from a MusePack sample file I got from a user.
It is not documented in the APE specification:

 http://wiki.hydrogenaudio.org/index.php?title=APE_key

People seem to be using undocumented extensions to the specification
anyway, and the best we can do is attempt to support them.
2010-06-30 21:16:28 +02:00
Max Kellermann 026bd15872 tag_ape: simplified the apeItems array
Make "enum tag_type" the array index, and convert apeItems to a sparse
array.
2010-06-30 21:15:52 +02:00
Max Kellermann 7cca55549b tag_ape: moved code to tag_ape_import_item()
Improve code readability.
2010-06-30 21:15:39 +02:00
Max Kellermann c7e89ea3a3 tag_ape: converted apeItems and tagItems to global vars
Don't initialize those arrays each time tag_ape_load() is called.
2010-06-30 21:15:14 +02:00
Max Kellermann 5a2820ca3d pcm_buffer: make the buffer pointer "void" 2010-06-30 08:21:48 +02:00
Max Kellermann 9eb292c1e5 decoder/mp4ff: support tag "album artist"
We already supported "albumartist", but it seems some folks also use
"album artist" (with a space).
2010-06-25 22:54:18 +02:00
Max Kellermann 5216cfb3c8 playlist_print: use playlist_open_any()
Allow printing remote playlists with the commands "listplaylist" and
"listplaylistinfo".
2010-06-25 22:43:52 +02:00
Max Kellermann 373d1843a8 playlist_queue: use playlist_open_any() 2010-06-25 22:43:52 +02:00
Max Kellermann 82ee278f53 playlist_any: new library to simplify opening playlist files
The new function playlist_open_any() combines playlist_mapper_open(),
playlist_list_open_uri() and playlist_list_open_stream(), providing an
easy API for all of them.
2010-06-25 22:43:52 +02:00
Max Kellermann c27fc26ecd playlist_list: probe plugin without MIME attributes
If the MIME type of a stream contains a semicolon, remove it and the
text after it to probe for a playlist plugin.
2010-06-25 22:43:52 +02:00
Max Kellermann fba13bd5d2 playlist_queue: simplify error handler
Return early on error, save one level of indent.
2010-06-25 22:37:34 +02:00
Max Kellermann 68f75955d8 playlist_list: moved input_stream.ready loop to calling function
Merged both loops into playlist_list_open_stream().  This is needed
because playlist_list_open_stream() needs to know the MIME type, which
is only known after the stream has become "ready".
2010-06-25 22:37:34 +02:00
Max Kellermann cd21cfc115 uri: really count dots in verify_uri_segment()
This buggy implementation failed to allow "..." sequences, because the
dot count was always zero.  The usefulness of allowing "..." (or more
dots) is debatable, but since it's a valid file name, we allow it.
2010-06-25 21:56:12 +02:00
Max Kellermann 1ea10db953 playlist/cue: last track ends at end of file
libcue's track_get_length() returns 0 for the last track, because that
information is not available in the CUE sheet.  This makes MPD quit
playing the last track immediately.  If we set "song.end_ms=0", MPD
will play the track until the end of the song file, which is what we
want.
2010-06-25 20:02:55 +02:00
Max Kellermann 6bb7a7439d song_print: simplified start_ms/end_ms check 2010-06-25 20:02:55 +02:00
Aaron Griffith ca6110d92f playlist_list: wait for input stream to become ready
Fixes an assertion failure in the input_stream_seek() call.
2010-06-25 19:20:20 +02:00
Andreas Vögele dda5415def Make get_remote_uid() work on BSD
I've attached a patch that will make file URIs work on operating systems
that provide the getpeereid() function call to check the user ID of the
peer connected to a UNIX domain socket.
2010-06-19 13:47:10 +02:00
Andrzej Rybczak 4347114455 client: increase send_buf from 4kB to 16kB
this greatly improves performance of commands that return a lot
of data, e.g. search results or recursive content of a directory,
while being connected to local mpd via tcp/ip socket.
2010-06-19 13:45:54 +02:00
Max Kellermann 9fb26b5617 playlist: check "queued" before calling playlist_update_queued_song()
Workaround for an assertion failure.
2010-06-19 13:45:15 +02:00
Max Kellermann 442b327582 playlist: protect acess to player state in playlist_sync() 2010-06-19 13:33:39 +02:00
Max Kellermann cff727644d playlist: move checks out of playlist_sync_with_queue()
Rename the function to playlist_song_started(), which gets only called
if the song has actually started.
2010-06-19 13:33:32 +02:00
Max Kellermann 7f80349494 player_control: hold mutex in pc_play(), pc_pause()
Race condition fix.
2010-06-19 13:19:30 +02:00
Max Kellermann d0d2d6ed1b filter/route: fixed unsigned/signed comparison
Fixes a clang warning.
2010-06-06 21:56:30 +02:00
Tim Phipps 4e83b79d2b output/httpd: add libwrap support
libwrap support is in MPD but only for the control port.  This patch
adds support for the http port.  The code is copied from
src/client_new.c
2010-06-06 21:53:24 +02:00
Max Kellermann 37e69a89b9 directory_print: print a list of playlist files in "lsinfo"
Print those files which can be handled by a playlist plugin.
2010-06-01 10:00:01 +02:00
Max Kellermann 6f28eb4c0a playlist_list: export playlist_suffix_supported() 2010-06-01 09:59:56 +02:00
Max Kellermann caf93d9a2c playlist_list: playlist_list_open_path() returns input_stream
Memory leak fix.  The input_stream object passed to
playlist_list_open_stream_suffix() must be closed by the caller - this
however never happens in playlist_list_open_path(), because it does
not return it to the caller.
2010-06-01 09:59:54 +02:00
Max Kellermann 747e945d29 playlist_list: move fallback g_uri_parse_scheme() to glib_compat.h 2010-06-01 09:59:52 +02:00
Max Kellermann 067d7212bf playlist: emit IDLE_OPTIONS when resetting single mode 2010-06-01 09:59:46 +02:00
Romain Bignon 867b93a5b2 single mode: at the end of the song, pause on the next song instead of stop 2010-05-31 23:36:16 +02:00
Max Kellermann 53647c8ba1 directory_print: return void
There is no useful return value here.
2010-05-31 22:16:03 +02:00
Romain Bignon b571ba27a4 fix crash when decoder is NULL 2010-05-31 22:11:59 +02:00
Max Kellermann de8f2739c2 decoder/mikmod: fix memory leak
The return value of Player_LoadTitle() is allocated with malloc(), and
must be freed by the caller.
2010-05-31 10:24:08 +02:00
Max Kellermann 2c1c588868 decoder/mikmod: duplicate the path only once 2010-05-31 10:22:08 +02:00
Max Kellermann e271f69a34 decoder/mikdmod: moved local variable declarations in tag_dup() 2010-05-31 10:16:09 +02:00
Max Kellermann 39105f2119 decoder/wildmidi: moved local variable declarations in tag_dup() 2010-05-31 10:14:48 +02:00
Max Kellermann 4e080a9b06 decoder/gme: replace macro GME_BUF_SIZE
Added macros with better names: GME_BUFFER_FRAMES, GME_BUFFER_SAMPLES
(the former only used to calculate the latter).
2010-05-31 10:03:43 +02:00
Max Kellermann d55740808d decoder/gme: added constants for sample rate and channels
Move into enums.
2010-05-31 10:02:43 +02:00
Max Kellermann 6566038df9 decoder/gme: pass the whole buffer to decoder_data()
Pass sizeof(buf) to decoder_data(), not the number of samples (which
is half the size).  At the same time, pass GME_BUF_SIZE to gme_play()
- libgme really wants to get the number of samples, not the number of
stereo frames.  Previously, this plugin had been using only the first
half of the buffer.
2010-05-31 09:57:15 +02:00
Max Kellermann f0faf00320 decoder/gme: allocate tag later, fixes memory leak
Allocate the "tag" object after the file has been opened successfully.
2010-05-31 09:43:25 +02:00
Max Kellermann 51c7577c8f decoder/mp4ff: rename and move local variable
Allocate the "tag" object after the file has been checked.  That
removes one tag_free() call in an error handler.
2010-05-31 09:35:49 +02:00
Max Kellermann be308c6657 decoder/mp4ff: merge code into mp4ff_input_stream_open() 2010-05-31 09:29:45 +02:00
Max Kellermann 1729a0b437 decoder/mp4ff: move mp4ff_callback_t into mp4ff_input_stream
Allocate only one item on the stack.
2010-05-31 09:23:27 +02:00
Max Kellermann 1b2fc2ae19 decoder/mp4ff: rename mp4_context to mp4ff_input_stream 2010-05-31 09:22:42 +02:00
Max Kellermann 58a75f0b78 decoder/mp4ff: remove duplicate entries in the tag name table
Reuse the function tag_name_parse_i().
2010-05-31 08:48:41 +02:00
Max Kellermann daf6e2b5da decoder/mp4ff: moved code to mp4ff_tag_name_parse() 2010-05-31 08:47:59 +02:00
Max Kellermann 71da5b026c tag_ape: remove duplicate entries in the tag name table
Reuse the function tag_name_parse_i().
2010-05-31 08:24:05 +02:00
Max Kellermann 2f68ea635b tag_ape: move code to tag_ape_name_parse() 2010-05-31 08:22:53 +02:00
Max Kellermann ca08c4dbf4 decoder/vorbis: rename local variable "ret" 2010-05-31 00:06:37 +02:00
Max Kellermann 8af52fa205 decoder/vorbis: implement method stream_tag()
This allows tags in archive files.
2010-05-31 00:02:57 +02:00
Max Kellermann 3b0bf856c4 decoder/vorbis: move code to vorbis_open_stream() 2010-05-31 00:00:04 +02:00
Max Kellermann 28f5803d34 decoder/vorbis: use single global ov_callbacks constant
Initialize the ov_callbacks struct at compile time.
2010-05-30 23:59:36 +02:00
Max Kellermann 0b72299857 decoder/vorbis: rename struct vorbis_decoder_data to vorbis_is 2010-05-30 23:57:58 +02:00
Max Kellermann 4a2302c2ed inotify_update: follow symlinks
This is probably unsafe, and doesn't protect against symlink loops,
but we will eventually add this when we bring update*.c and inotify*.c
closer together.
2010-05-30 23:45:47 +02:00
Max Kellermann 980201a665 inotify_update: fix assertion failure when music dir is deleted
This shouldn't really happen, but insane users might delete/rename the
music directory while MPD runs.  What was even more insane was that
MPD crashed due to this.  This is a workaround - there is currently
nothing useful we can do in this case; except maybe poll for the music
directory to reappear, but that's too much trouble for a user error.
2010-05-30 23:45:46 +02:00
Max Kellermann 017d61a1aa decoder/mp4ff: support tags "albumartist", "band"
I'm not sure if mapping "band" to TAG_PERFORMER is correct, but it
might be better than nothing.
2010-05-30 22:55:02 +02:00
Max Kellermann 4028d03a6e decoder/mp4ff: use tag_table.h to parse tag names
Convert if/else/else/... to a loop.
2010-05-30 22:52:45 +02:00
Max Kellermann 44b771aca1 decoder/mp4ff: rename plugin "mp4" to "mp4ff"
The underlying library is named "libmp4ff".  To reduce confusion,
rename the plugin to a more specific name.
2010-05-30 22:52:44 +02:00
Max Kellermann 8c581eca4d tag_ape: move table lookup to tag_table.h
Allow code sharing.
2010-05-30 22:52:19 +02:00
Max Kellermann 8e815bec9f tag_ape: support album artist, MusicBrainz tags
I took these tag names from a MusePack sample file I got from a user.
These are not documented in the APE specification:

 http://wiki.hydrogenaudio.org/index.php?title=APE_key

People seem to be using undocumented extensions to the specification
anyway, and the best we can do is attempt to support them.
2010-05-30 22:29:48 +02:00
Max Kellermann 9dda53e1d2 Merge release 0.15.10 from branch 'v0.15.x'
Conflicts:
	NEWS
	configure.ac
	src/input/mms_input_plugin.c
2010-05-30 18:26:33 +02:00
Max Kellermann 442d2e74e3 decoder/mad: fix buffer variable name on !HAVE_ID3TAG 2010-05-30 17:27:03 +02:00
Daniel Seuthe e8310211e2 filter/replay_gain: added option "replaygain_limit" 2010-05-30 17:06:08 +02:00
Avuton Olrich 894573657d cmdline: Add default config paths for win32. 2010-05-20 06:56:43 -07:00
Max Kellermann 9cce1d749a output/win32: new output plugin for Windows Wave 2010-05-20 09:33:05 +02:00
Max Kellermann ed0b48040c pcm_buffer: 8 kB alignment instead of 64 kB
Reduce the overhead.  Most buffers used by MPD are around 2 to 4 kB.
8 kB seems large enough to keep heap fragmentation low.

Additionally, this patch fixes an off-by-one error in the alignment
formula.
2010-05-20 09:31:51 +02:00
Max Kellermann eda46bc07f tag_{id3,ape}: explicitly open files in binary mode
Add the flag "b" to fopen().  Windows compatibility.
2010-05-20 09:14:11 +02:00
Max Kellermann c727e86980 input/file, output/{fifo,recorder}: add O_BINARY to open() flags
Windows compatibility.
2010-05-20 09:13:39 +02:00
Max Kellermann 57b4013306 client: use sprintf() on WIN32
On mingw32, snprintf() expects a 64 bit integer instead of a "long
int" for "%li" - this is not consistent with our expectation, so we're
using plain sprintf().
2010-05-19 13:12:37 +02:00
Max Kellermann 8248f498b2 event_pipe: use g_io_channel_read_chars() to drain the pipe
For some unknown reason, read() blocks on WIN32, even though it was
invoked inside the G_IO_IN callback.  By switching to GIOChannel
functions, this problem is solved, and it works on both Linux and
Windows.
2010-05-19 11:37:39 +02:00
Max Kellermann 22f3ffb099 event_pipe: call g_io_channel_win32_new_fd()
On WIN32, use g_io_channel_win32_new_fd() instead of
g_io_channel_unix_new().  There doesn't seem to be a practical
difference, but it seems more correct.
2010-05-19 11:37:22 +02:00
Max Kellermann 81bd8ef73c update_walk: don't check recursive symlinks on WIN32
inode numbers don't work on WIN32, and very few WIN32 users actually
use symlinks - seems ok to disable that check.
2010-05-19 11:36:07 +02:00
Max Kellermann bedc172eab crossfade: emulate strtok_r() on WIN32 with a function
Not a CPP macro.  This adds the "unused" attribute to "saveptr", which
eliminates one gcc warning.
2010-05-18 23:56:53 +02:00
Max Kellermann 0a9b0dd070 command: fallback strftime() formats on WIN32
On WIN32, "%F" and "%T" are not implemented.
2010-05-18 23:54:12 +02:00
Max Kellermann 6aa0f61e15 socket_util: fix setsockopt() argument type on WIN32
In the winsock headers, the setsockopt() argument is declared as
"const char *", not "const void *".
2010-05-18 23:13:05 +02:00
Max Kellermann 4461c3d5d1 daemon: include glib.h on WIN32 for g_error() 2010-05-18 23:13:05 +02:00
Max Kellermann fef46bcf49 fd_util: fd_set_cloexec() returns a value on WIN32
This function is empty on WIN32, but we need to return a value.
2010-05-18 23:09:07 +02:00
Max Kellermann fa2ff849c5 input/ffmpeg: new input plugin using libavformat's "avio" library 2010-05-18 21:20:31 +02:00
Max Kellermann 6b2b91ff01 input/mms: removed empty method buffer()
input_stream_buffer() has a check for "buffer==NULL", so we don't need
an explicit empty implementation.
2010-05-18 21:20:31 +02:00
Max Kellermann 28736414a8 input/mms: initialize the "eof" attribute 2010-05-18 21:11:00 +02:00