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
Max Kellermann
0cf4f09e4f
output_api: removed audio_output_get_name()
...
Use config_get_block_string("name") instead of audio_output_get_name().
2009-02-25 17:32:58 +01:00
Max Kellermann
4726c7f709
test: added encoder test program
...
Added a command line program which runs an encoder plugin.
2009-02-25 17:12:14 +01:00
Max Kellermann
e0e92e050e
test: added decoder test program
...
Added a command line program which runs a decoder plugin.
2009-02-25 17:09:09 +01:00
Max Kellermann
bdb3129f18
configure.ac: declare AM_CFLAGS
...
Moved generic compiler options to AM_CFLAGS. MPD_CFLAGS/MPD_LIBS will
hopefully fade away one day, in favor of more fine-grained variables.
2009-02-25 16:46:07 +01:00
Max Kellermann
6fdaa49668
Makefile.am: use AM_CPPFLAGS, AM_LDFLAGS
...
Renamed the old AM_CFLAGS to AM_CPPFLAGS, because it contained only
preprocessor options. Append it to src_mpd_CPPFLAGS. Removed
GLIB_LIBS from src_mpd_CPPFLAGS, because it is already part of
AM_LDFLAGS.
2009-02-25 16:45:23 +01:00
Max Kellermann
02c9c3e0d8
Makefile.am: added per-subsystem variables
...
Added "make" variables for the sources and dependencies of each
subsystem (archive, input, output, decoder, encoder, mixer).
2009-02-25 16:44:11 +01:00
Max Kellermann
6823217697
ls: moved generic URI utilities to uri.c
...
"ls" is a bad name for a library which parses URIs. We'll move the
rest of the "ls" library later.
2009-02-25 16:44:06 +01:00
Max Kellermann
7957fefc91
test/software_volume: pass error->message to g_printerr()
...
Fix a gcc warning.
2009-02-25 16:44:05 +01:00
Max Kellermann
2054464c01
vorbis_encoder: vorbis_encoder_clear() returns void
...
Don't return an uninitialized bool variable.
2009-02-24 19:06:37 +01:00
Max Kellermann
e065c4db33
jack: initialize local variable "space"
...
Fix a gcc warning, initialize the "space" variable at the beginning of
mpd_jack_play().
2009-02-24 19:06:34 +01:00