Commit Graph

3828 Commits

Author SHA1 Message Date
Max Kellermann
3d6e6416e5 update: moved code to update_archive_file()
Simplify the rather large function update_regular_file().
2009-02-28 14:01:33 +01:00
Max Kellermann
7473fa0f4e directory: moved DIRECTORY_* string constants
Moved some of them to to directory_save.c, and others to database.c.
2009-02-27 19:30:16 +01:00
Max Kellermann
eae0287466 song_print: hide HTTP password in playlist
Added the uri_remove_auth() library function which strips username
and password from a HTTP URI, and use it in song_print_url().  This
allows you to add HTTP URIs to the playlist including secret username
and password, without disclosing it to all MPD clients.
2009-02-27 19:20:11 +01:00
Max Kellermann
9dd00dfab7 client: removed duplicate "client" string from log
Since we introduced a GLib logging domain, the "client" string appears
twice in the log lines:

 client: client 0: command returned 0

Removed the second one, now it looks like this:

 client: [0] command returned 0

Still not quite good, but better than before.
2009-02-27 19:03:13 +01:00
Max Kellermann
53271e8ae7 update: print error when opendir() fails
MPD used to be silent when it could stat() a directory, but could not
opendir() it to read its contents.  This caused a lot of support
headache with users who have wrong file permissions.  Add another
warning message.
2009-02-27 09:05:58 +01:00
Max Kellermann
497c0b1c18 tag: don't accept invalid UTF-8 sequences
Overwrite invalid UTF-8 sequences with question marks.
2009-02-27 09:02:32 +01:00
Max Kellermann
c1ab2d06aa tag: make tag.num_items unsigned
There's no point in declaring num_items as a uint8_t, it doesn't save
any space, due to padding.  This allows us to lift the articial "255
items" limitation.
2009-02-27 09:02:13 +01:00
Max Kellermann
75c2029b1c tag: no CamelCase
Renamed numOfItems to num_items.
2009-02-27 09:01:55 +01:00
Max Kellermann
5b07cbf0b4 tag: make tag_equal() return bool 2009-02-27 08:06:59 +01:00
Max Kellermann
bcdf947afc player_thread: removed meaningless warning on output failure
The warning message "problems opening audio device while playing ..."
does not help at all, and should be removed.  At this point, the real
error message has already been logged by the output thread.
2009-02-26 22:21:35 +01:00
Max Kellermann
9e61c0503e output_all: print a warning when all outputs are disabled
When all outputs are disabled, MPD printed only a meaningless message
"problems opening audio device", although it didn't attempt to open a
device.
2009-02-26 22:21:32 +01:00
Max Kellermann
58c201ce14 output_all: removed "audio_outputs!=NULL" check
After initialization, audio_outputs is always non-NULL.  Don't check
that.
2009-02-26 22:14:54 +01:00
Max Kellermann
dfea6b7cdd mvp: fixed default device detection
The check "open()!=0" is wrong, you have to write "open()>=0", because
-1 means error, and 0 is a valid file handle.
2009-02-26 22:10:58 +01:00
Max Kellermann
ec926539a3 output_plugin: report errors with GError
Use GLib's GError library for reporting output device failures.

Note that some init() methods don't clean up properly after a failure,
but that's ok for now, because the MPD core will abort anyway.
2009-02-26 22:04:59 +01:00
Max Kellermann
353ae5e558 osx: use OSStatus and GetMacOSStatusCommentString()
The return type of most OS X functions is OSStatus, not int.  We can
get a nice error message from GetMacOSStatusCommentString(), log it.
2009-02-26 22:01:42 +01:00
Max Kellermann
9dc966041d osx: start the audio device in the open() method
Don't call AudioOutputUnitStart() in the play() method, do it after
the device has been opened.  We can eliminate the "started" property
now, because the device is always started when it's open.
2009-02-26 21:40:22 +01:00
Max Kellermann
fb5ca6aa29 osx: removed commented code
We don't need to keep commented code forever.  If we want that
test_default_device() implementation back one day, we'll pick it from
the git history.
2009-02-26 21:33:13 +01:00
Max Kellermann
985ca094f2 osx: no CamelCase
Renamed types, functions, variables.
2009-02-26 21:03:06 +01:00
Max Kellermann
a7b0cfccb4 output_thread: use the right audio_format in assert()
ao_play() gets PCM data in the in_audio_format, and converts it to
out_audio_format.  Comparing the input data with out_audio_format is
wrong.

prefixed with "STG:" will be automatically removed.  STG: Trailing
empty lines will be automatically removed.  STG: vi: set textwidth=75
filetype=diff nobackup:
2009-02-26 21:02:39 +01:00
Max Kellermann
bcc3a9debf shout: use config_get_block_unsigned()
Eliminated manual integer parsing.
2009-02-26 19:34:00 +01:00
Max Kellermann
710a61a3dc pulse: removed pa_simple!=NULL checks
The MPD core guarantees that the audio_output object is always
consistent, and our pa_simple!=NULL checks are superfluous.  Also
don't manually close the device on error in pulse_play(), since the
MPD core does this automatically when the play() method returns 0.
2009-02-26 19:29:06 +01:00
Max Kellermann
4f2ac7ec2c oss: moved code from oss_open() to oss_setup()
Eliminate one label and a bunch of gotos.
2009-02-26 19:18:16 +01:00
Max Kellermann
749d6c7766 oss: convert OSS_STAT_* to an enum
Use C instead of CPP.
2009-02-26 19:18:13 +01:00
Max Kellermann
a0b3f35537 oss: return bool instead of int
Return type of oss_find_supported_param(), oss_can_convert() and
oss_find_unsupported_param() should be bool instead of int.
2009-02-26 19:17:56 +01:00
Max Kellermann
e1f58fdcf5 oss: use unsigned integers
Convert the num_supported and num_unsupported variables from signed to
unsigned.
2009-02-26 19:17:09 +01:00
Max Kellermann
4958a6f56f oss: no CamelCase
Renamed types, functions and variables.
2009-02-26 19:16:33 +01:00
Avuton Olrich
90ee488597 mixer: Add "disabled" mixer_type. 2009-02-26 09:13:07 -08:00
Avuton Olrich
1b79449ef1 cmdline: Alphabetical help order like other GNU projects. 2009-02-25 15:34:57 -08:00
Avuton Olrich
de07547426 cmdline: Add --no-config to explicitly set daemon default options. 2009-02-25 15:30:52 -08:00
Max Kellermann
a4cf7b7dfd alsa: fall back to 16 bit audio
When the sample format is unknown, fall back to 16 bit samples.
2009-02-25 22:01:32 +01:00
Max Kellermann
4c1fb8278b alsa: moved code from alsa_open() to alsa_setup()
Simplify error handling a bit by moving some code into a separate
function.  This eliminates a good bunch of gotos, but that's not
finished yet.
2009-02-25 22:01:30 +01:00
Max Kellermann
d3409a65b5 mvp: check for reopen errors
When the MVP device has been closed in the cancel() method, and the
play() method attempts to reopen it, check for errors.
2009-02-25 21:57:02 +01:00
Max Kellermann
883e31d55b mvp: moved code to mvp_find_sample_rate()
Moved the table lookup code to a separate function.
2009-02-25 21:56:48 +01:00
Max Kellermann
b4c65cac8c mvp: make the mvp_sample_rates array const
The array must never be modified, it's a constant lookup table.
2009-02-25 21:54:02 +01:00
Max Kellermann
99f535ad77 mvp: fall back to 16 bit audio samples
Looks like the MVP audio output only supports 16 and 24 bit audio
samples.  If MPD generates any other sample formats, force it to use
16 bit.
2009-02-25 21:52:11 +01:00
Max Kellermann
8491f61d6c mvp: fall back to stereo
When the channel count is greater than 2, fall back to stereo sound.
2009-02-25 21:51:39 +01:00
Max Kellermann
6722c508a1 mvp: mvp_set_pcm_params() returns bool
Return true/false instead of 0/-1.  Also check its return value in
mvp_output_open().
2009-02-25 21:51:36 +01:00
Max Kellermann
84ed6d4701 mvp: pass audio_format struct to mvp_set_pcm_params()
Pass a pointer to the audio_format struct instead of 3 separate
integers.
2009-02-25 21:51:32 +01:00
Max Kellermann
57a9e5605b mvp: removed big_endian parameter from mvp_set_pcm_params()
Don't pass the big_endian flag to mvp_set_pcm_params(), do a simple
"G_BYTE_ORDER==G_LITTLE_ENDIAN" instead.
2009-02-25 21:51:13 +01:00
Max Kellermann
d902465375 mvp: use G_N_ELEMENTS(mvp_sample_rates)
Instead of manually calculating the number of elements in the
mvp_sample_rates array, use GLib's convenience macro G_N_ELEMENTS().
2009-02-25 21:50:50 +01:00
Max Kellermann
fff52ac5b9 mvp: no CamelCase
Renamed types, functions and variables.
2009-02-25 21:49:59 +01:00
Max Kellermann
6aa6def776 output: audio_output_init() returns bool
Return true/false instead of 1/0.
2009-02-25 19:53:56 +01:00
Max Kellermann
9512704055 output: set a GLib log domain 2009-02-25 19:53:38 +01:00
Max Kellermann
d56ae1e9c2 fifo: return bool values
Return true/false for success/failure instead of returning 0/-1.
2009-02-25 19:53:27 +01:00
Max Kellermann
74af4e4c3d fifo: no CamelCase
Renamed types, functions and variables.
2009-02-25 19:53:24 +01:00
Max Kellermann
ee7cf9c9b8 fifo: removed timer!=NULL checks
The MPD core guarantees that the audio_output object is always
consistent, and our timer!=NULL checks are superfluous.
2009-02-25 19:09:38 +01:00
Max Kellermann
ba4dd651ef ao: no CamelCase
Renamed functions and variables.
2009-02-25 19:08:49 +01:00
Max Kellermann
074d5ae13e ao: removed AoData.device!=NULL checks
The MPD core guarantees that the audio_output object is always in a
consistent state: either open or closed.  When open, it will not call
the open() method again, and when closed, it will not call play().
Removed several checks and the NULL initialization.
2009-02-25 18:48:27 +01:00
Max Kellermann
8a882209c3 ao: removed implementation of method cancel()
The method is empty, and we can simply set the method pointer to NULL
instead.
2009-02-25 18:45:09 +01:00
Max Kellermann
dcd84c19cd output_plugin: don't pass audio_output object to method init()
audio_output_get_name() has been removed, which was the only function
left in output_api.h.  The output plugin doesn't need the audio_output
object at all, remove the parameter from the init() method.
2009-02-25 18:34:02 +01:00