aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_init.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-03-26output_plugin: replaced output_plugin.get_mixer() with mixer_pluginMax Kellermann1-0/+6
The mixer core library is now responsible for creating and managing the mixer object. This removes duplicated code from the output plugins.
2009-03-20output: convert audio_output.config_audio_format to booleanMax Kellermann1-5/+6
The config_audio_format used to contain the configured audio format, which is copied to out_audio_format. Let's convert the former to a boolean, which indicates whether out_audio_format was already set. This simplifies some code and saves a few bytes.
2009-03-13all: Update copyright header.Avuton Olrich1-6/+7
This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
2009-03-09output: play from a music_pipe objectMax Kellermann1-0/+1
Instead of passing individual buffers to audio_output_all_play(), pass music_chunk objects. Append all those chunks asynchronously to a music_pipe instance. All output threads may then read chunks from this pipe. This reduces MPD's internal latency by an order of magnitude.
2009-03-01output_init: removed getBlockParam()Max Kellermann1-18/+20
Use config_get_block_string() and manual GError handling instead.
2009-03-01output_init: return GError on errorMax Kellermann1-19/+15
Do error handling with GError instead of aborting with g_error().
2009-03-01output_init: moved code to audio_output_detect()Max Kellermann1-16/+26
2009-02-28output: use GTimer instead of time_t for reopen after failureMax Kellermann1-1/+1
time() is not a monotonic timer, and MPD might get confused by clock skews. clock_gettime() provides a monotonic clock, but is not portable to non-POSIX systems (i.e. Windows). This patch uses GLib's GTimer API, which aims to be portable.
2009-02-28output: added option to disable audio outputs by defaultMax Kellermann1-1/+1
The option "enabled" is on by default. If you specify "enabled no" in an audio_output section, then this device is disabled by default.
2009-02-26output_plugin: report errors with GErrorMax Kellermann1-3/+8
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-25output: audio_output_init() returns boolMax Kellermann1-4/+4
Return true/false instead of 1/0.
2009-02-25output: set a GLib log domainMax Kellermann1-0/+3
2009-02-25output_plugin: don't pass audio_output object to method init()Max Kellermann1-1/+1
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-16output_plugin: added inline wrapper functionsMax Kellermann1-3/+4
Similar to the decoder plugin API: added wrapper functions to increase code readability.
2009-02-11audio: replaced parseAudioConfig() with audio_format_parse()Max Kellermann1-4/+9
Added audio_format_parse() in a separate library, with a modern interface: return a GError instead of logging errors. This allows the caller to deal with the error.
2009-02-10output_api: no CamelCase in struct audio_outputMax Kellermann1-4/+5
Renamed audio_output struct members.
2009-01-25conf: const pointers in block get functionsMax Kellermann1-1/+1
All config_get_block_*() functions should accept constant config_param pointers.
2009-01-17conf: no CamelCase, part IMax Kellermann1-2/+3
Renamed functions, types, variables.
2009-01-17pcm_convert: return PCM buffer from pcm_convert()Max Kellermann1-3/+0
Removed yet another superfluous buffer layer: return the PCM buffer from pcm_convert() instead of copying PCM data into the caller-supplied buffer.
2008-12-28output: migrate from pthread to glib threadsThomas Jansen1-1/+1
2008-11-25output: use GLib instead of log.h/util.hMax Kellermann1-15/+16
2008-10-29output: delay reopen after device failureMax Kellermann1-0/+1
When one of several output devices failed, MPD tried to reopen it quite often, wasting a lot of resources. This patch adds a delay: wait 10 seconds before retrying. This might be changed to exponential delays later, but for now, it makes the problem go away.
2008-10-29output: moved audioDeviceStates to audio_output.enabledMax Kellermann1-0/+1
2008-10-29output: use bool for return values and flagsMax Kellermann1-2/+2
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
2008-10-21pcm_utils: added pcm_convert_init()Max Kellermann1-1/+1
Instead of manually calling memset(0) on the pcm_convert_state struct, client code should use a library function from pcm_utils.c. This way, we can change the semantics of the struct easily.
2008-10-21pcm_utils: renamed ConvState to struct pcm_convert_stateMax Kellermann1-1/+1
No CamelCase, and a struct instead of a typedef.
2008-09-24output: make "struct audio_output" opaque for output pluginsMax Kellermann1-1/+3
We have eliminated direct accesses to the audio_output struct from the all output plugins. Make it opaque for them, and move its real declaration to output_internal.h, similar to decoder_internal.h. Pass the opaque structure to plugin.init() only, which will return the plugin's data pointer on success, and NULL on failure. This data pointer will be passed to all other methods instead of the audio_output struct.
2008-09-24output: pass audio_format to plugin.init() and plugin.open()Max Kellermann1-1/+1
Pass the globally configured audio_format as a const pointer to plugin.init(). plugin.open() gets a writable pointer which contains the audio_format requested by the plugin. Its initial value is either the configured audio_format or the input file's audio_format.
2008-09-24output: one thread per audio outputMax Kellermann1-0/+4
To keep I/O nastiness and latencies away from the core, move the audio output code to a separate thread, one per output. The thread is created on demand, and currently runs until mpd exits.
2008-09-11output: don't initialize inAudioFormat, outAudioFormatMax Kellermann1-4/+0
As long as the device isn't open, both attributes are not used. Since they will both be initialized in audio_output_open(), we do not need the initialization in audio_output_init().
2008-09-11output: removed audio_output.sameInAndOutFormatsMax Kellermann1-1/+0
Eliminate sameInAndOutFormats and check with audio_format_equals() each time it this information is needed. Another 4 bytes saved.
2008-09-11output: removed audio_output.convertAudioFormatMax Kellermann1-5/+2
Instead of checking convertAudioFormat, we can simply check if reqAudioFormat is defined. This saves 4 bytes in the struct.
2008-09-09audio: replaced copyAudioFormat() with simple assignmentMax Kellermann1-1/+1
The "!src" check in copyAudioFormat() used to hide bugs - one should never pass NULL to it. There is one caller which might pass NULL, add a check in this caller. Instead of doing mempcy(), we can simply assign the structures, which looks more natural.
2008-09-09output: renamed the functions in output_control.cMax Kellermann1-1/+1
Getting rid of CamcelCase, again.
2008-09-09output: moved code from audioOutput.c to output_control.cMax Kellermann1-117/+1
Similar to decoder_control.c, output_control.c will provide functions for controlling the output thread (which will be implemented later).
2008-09-09output: renamed method namesMax Kellermann1-12/+11
No CamelCase. Also don't declare typedefs for the methods.
2008-09-08output: static audio_output_plugin list as arrayMax Kellermann1-44/+11
Instead of having to register each output plugin, store them statically in an array. This eliminates the need for the List library here, and saves some small allocations during startup.
2008-09-07output: replace audio_output.*Func with audio_output.pluginMax Kellermann1-17/+11
Instead of copying all that stuff from the audio output plugin to the audio output structure, store a pointer to the plugin.
2008-09-07output: renamed typedef AudioOutput to struct audio_outputMax Kellermann1-15/+16
Also rename AudioOutputPlugin to struct audio_output_plugin, and use forward declarations to reduce include dependencies.
2008-09-07output: added output_api.hMax Kellermann1-0/+1
Just like decoder_api.h, output_api.h provides the audio output API which is used by the plugins.
2008-09-07audio_format: converted typedef AudioFormat to struct audio_formatMax Kellermann1-4/+4
Get rid of CamelCase, and don't use a typedef, so we can forward-declare it, and unclutter the include dependencies.
2008-08-29tag: renamed MpdTag and MpdTagItem to struct tag, struct mpd_tag_itemMax Kellermann1-1/+2
Getting rid of CamelCase; not having typedefs also allows us to forward-declare the structures.
2008-08-29pass constant pointersMax Kellermann1-1/+1
And again, convert arguments to const.
2008-08-26moved struct AudioFormat to audio_format.hMax Kellermann1-0/+1
We want to expose the AudioFormat structure to plugins; remove some clutter by moving its declaration to a separate header file.
2008-04-12const pointers in audioOutput.cMax Kellermann1-1/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@7345 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12use free()/malloc() instead of realloc()Max Kellermann1-2/+3
When growing the audioOutput->convBuffer, we can use free()+malloc() instead of realloc(), which saves a memcpy(). git-svn-id: https://svn.musicpd.org/mpd/trunk@7295 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12use size_t in audioOutput.c internalsMax Kellermann1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@7294 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12use size_t and constant pointer in ao pluginsMax Kellermann1-3/+4
The audio output plugins should get a constant pointer, because they must not modify the buffer. Since the size is a non-negative buffer size in bytes, we should change its type to size_t. git-svn-id: https://svn.musicpd.org/mpd/trunk@7293 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12use size_t for pcm_sizeOfConvBuffer() resultMax Kellermann1-4/+4
In my previous patch set, I forgot to change the pcm_sizeOfConvBuffer() invocation in convertAudioFormat() to also use size_t. git-svn-id: https://svn.musicpd.org/mpd/trunk@7292 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-02-05fix -Wconst warningsMax Kellermann1-2/+2
[ew: cleaned up the dirty union hack a bit] Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f