aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_all.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-03-26output_all: synchronize playback with player_control.notifyMax Kellermann1-1/+2
This patch fixes a longer delay when moving around songs in the playlist. The main thread wants to enqueue a new "next" song into the player thread, but the player thread is waiting inside audio_output_all_wait() for the output threads. Use player_control.notify there, so audio_output_all_wait() gets woken up by the main thread, too.
2009-03-25output_all: synchronize playback with a notify objectMax Kellermann1-2/+1
Use audio_output_client_notify instead of g_usleep(1ms) in audio_output_all_wait() to synchronize with the output_thread. Signal the audio_output_client_notify object in ao_play().
2009-03-25output_all: moved code to audio_output_all_wait()Max Kellermann1-0/+12
Synchronization with the output thread will be implemented in output_all.c, not in player_thread.c. Currently, that's just a simple g_usleep(1ms).
2009-03-25output: protect audio_output.open with the mutexMax Kellermann1-12/+23
There was a deadlock between the output thread and the player thread: when the output thread failed (and closed itself) while the player thread worked with the audio_output object, MPD could crash.
2009-03-16output_all: check param!=NULL before accessing itMax Kellermann1-2/+7
When printing the error message, MPD dereferences the NULL pointer to print an error message if no audio_output section is present.
2009-03-14output_all: added missing "unused" attributeMax Kellermann1-1/+1
In NDEBUG, clear_tail_chunk() does not use its "chunk" parameter.
2009-03-14output_all: include chunk.hMax Kellermann1-0/+1
The source output_all.c accesses music_chunk struct members, but did not include chunk.h directly.
2009-03-13all: Update copyright header.Avuton Olrich1-3/+4
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-12output_all: fix off-by-one error in audio_output_all_check()Max Kellermann1-1/+1
When there are chunks which are not yet finished, audio_output_all_check() returned the size of its music pipe minus one. I can't remember exactly why I subtracted 1 from the return value, it must have had something to do with a former meaning of this function. Now it induces assertion failures.
2009-03-10output_all: clear input_audio_format on closeMax Kellermann1-0/+2
When the audio outputs are closed, also clear the audio format. If we don't do this, every call to audio_output_all_update() will open the device, even if it's meant to be paused.
2009-03-10output_all: don't allow audio_format==NULL in audio_output_all_open()Max Kellermann1-5/+3
Don't allow reopening an audio device after pause with audio_format==NULL, force the caller to provide the audio_format each time.
2009-03-09output: play from a music_pipe objectMax Kellermann1-42/+182
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-07output_all: fix boolean short circuit in update()Max Kellermann1-2/+2
Sometimes, audio_output_update() isn't called for the second device when the first one has succeeded. The patch "audio_output_all_update() returns bool" broke it, because the boolean evaluation ended after the first "true".
2009-03-07output_all: audio_output_all_update() returns boolMax Kellermann1-3/+12
audio_output_all_update() returns true when there is at least open output device which is open.
2009-03-01output_init: return GError on errorMax Kellermann1-12/+3
Do error handling with GError instead of aborting with g_error().
2009-02-28output: use GTimer instead of time_t for reopen after failureMax Kellermann1-2/+8
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-26output_all: print a warning when all outputs are disabledMax Kellermann1-1/+7
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-26output_all: removed "audio_outputs!=NULL" checkMax Kellermann1-3/+0
After initialization, audio_outputs is always non-NULL. Don't check that.
2009-02-25output: set a GLib log domainMax Kellermann1-0/+3
2009-02-16output: include cleanupMax Kellermann1-0/+2
Don't include output_api.h in output_internal.h. This change requires adding missing includes in several sources.
2009-02-10output_all: immediately reopen output on playMax Kellermann1-0/+13
When MPD explicitly starts playing, ignore the "REOPEN_AFTER" timeout. This timeout was useful when MPD attempted to reopen a failed device over and over, but it confuses users when they explicitly tell MPD to start playing, while MPD insists to wait for the 10 seconds to pass.
2009-02-10output_all: moved code to audio_output_all_finished()Max Kellermann1-13/+16
audio_output_all_finished() returns bool, not int.
2009-02-10output_all: no CamelCaseMax Kellermann1-58/+66
Renamed functions and variables.
2009-02-10audio: moved code to output_all.cMax Kellermann1-154/+5
Moved code which deals with all audio outputs at once into a separate library.
2009-02-10audio: moved protocol code to output_print.cMax Kellermann1-16/+0
2009-02-10audio: moved state file code to output_state.cMax Kellermann1-53/+0
2009-02-10audio: removed isCurrentAudioFormat()Max Kellermann1-8/+0
This function isn't used anymore.
2009-02-10audio: added output enumeration functionsMax Kellermann1-0/+22
Added audio_output_get(), audio_output_find().
2009-02-10audio: added audio_output_config_count()Max Kellermann1-1/+7
audio_output_config_count() returns the number of audio outputs in the configuration file. It is only used by initAudioDriver(). The public function audio_output_count() now returns audioOutputArraySize.
2009-01-25use g_free() instead of free()Max Kellermann1-1/+1
On some platforms, g_free() must be used for memory allocated by GLib. This patch intends to correct a lot of occurrences, but is probably not complete.
2009-01-25mixer: removed mixer_configure_legacy(), AC_MIXER_CONFIGUREMax Kellermann1-17/+0
Those have been superseded by the new legacy configuration code.
2009-01-25conf: const pointers in block get functionsMax Kellermann1-3/+3
All config_get_block_*() functions should accept constant config_param pointers.
2009-01-17conf: no CamelCase, part IMax Kellermann1-6/+6
Renamed functions, types, variables.
2009-01-04renaming mixer.h to mixer_api.hViliam Mateicka1-1/+1
2009-01-03audio: use GLib instead of utils.hMax Kellermann1-2/+2
2008-12-31Moving mixers to audio outputsViliam Mateicka1-0/+55
2008-12-31exporting functionsViliam Mateicka1-1/+1
2008-12-29removed os_compat.hMax Kellermann1-1/+2
Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.
2008-12-28utils: removed myFgets()Max Kellermann1-1/+3
Replaced myFgets() with fgets() + g_strchomp().
2008-12-27output_control: no static "notify" initializationMax Kellermann1-0/+4
Don't use NOTIFY_INITIALIZER to initialize audio_output_client_notify.
2008-11-25output: use GLib instead of log.h/util.hMax Kellermann1-19/+18
2008-11-02output: don't allow length==0Max Kellermann1-0/+1
Nobody should call playAudio() with an empty chunk. Add some assertions on that.
2008-10-29output: removed audio_output.resultMax Kellermann1-5/+3
Since open() and play() close the device on error, we can simply check audio_output.open instead of audio_output.result after a call.
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 code to audio_output_update()Max Kellermann1-8/+2
Moved code from syncAudioDeviceStates() to audio_output_update().
2008-10-29output: always call cancel() before stop()Max Kellermann1-10/+1
Stopping an audio output device without cancelling its buffer doesn't make sense. Combine the two operations, which saves several cancel calls.
2008-10-29output: moved audioDeviceStates to audio_output.enabledMax Kellermann1-20/+6
2008-10-29output: use bool for return values and flagsMax Kellermann1-14/+14
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
2008-10-29audio: call closeAudioDevice() on errorMax Kellermann1-5/+2
Instead of implementing another loop which calls audio_output_close() on all configured devices, simply call closeAudioDevice().
2008-10-29audio: removed variable "audioOpened"Max Kellermann1-9/+1
This variable is never read, and can be removed.