aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_control.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* audio_output: workaround for deadlockMax Kellermann2008-09-261-0/+6
| | | | | | | | During debugging, I found a deadlock between flushAudioBuffer() and the audio_output_task(): audio_output_task() didn't notice that there is a command, and flushAudioBuffer() waited forever in notify_wait(). I am not sure yet what is the real cause; work around this for now by waking up non-finished audio outputs in every iteration.
* output: semi-asynchronous playbackMax Kellermann2008-09-241-8/+14
| | | | | | | Send an output buffer to all output plugins at the same time, instead of waiting for each of them separately. Make several functions non-blocking, and introduce the new function audio_output_wait_all() to synchronize with all audio output threads.
* output: make "struct audio_output" opaque for output pluginsMax Kellermann2008-09-241-1/+2
| | | | | | | | | | | 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.
* output: one thread per audio outputMax Kellermann2008-09-241-38/+39
| | | | | | 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.
* output: copy reqAudioFormat to outAudioFormat only if not yet openMax Kellermann2008-09-111-1/+7
| | | | | | If the output device is already open, it may have modified outAudioFormat; in this case, outAudioFormat is still valid, and does not need an overwrite.
* output: removed audio_output.sameInAndOutFormatsMax Kellermann2008-09-111-6/+2
| | | | | Eliminate sameInAndOutFormats and check with audio_format_equals() each time it this information is needed. Another 4 bytes saved.
* output: removed audio_output.convertAudioFormatMax Kellermann2008-09-111-1/+1
| | | | | Instead of checking convertAudioFormat, we can simply check if reqAudioFormat is defined. This saves 4 bytes in the struct.
* audio: moved cmpAudioFormat() to audio_format.hMax Kellermann2008-09-091-4/+3
| | | | | Rename it to audio_format_equals() and return "true" if they are equal.
* audio: replaced copyAudioFormat() with simple assignmentMax Kellermann2008-09-091-5/+3
| | | | | | | | | 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.
* output: renamed the functions in output_control.cMax Kellermann2008-09-091-11/+11
| | | | Getting rid of CamcelCase, again.
* output: moved code from audioOutput.c to output_control.cMax Kellermann2008-09-091-0/+123
Similar to decoder_control.c, output_control.c will provide functions for controlling the output thread (which will be implemented later).