aboutsummaryrefslogtreecommitdiffstats
path: root/src/OutputAll.cxx (unfollow)
Commit message (Collapse)AuthorFilesLines
2013-10-17Thread/Thread: replacement library for GThreadMax Kellermann1-0/+2
2013-10-02Log: new logging library APIMax Kellermann1-3/+0
Prepare to migrate away from GLib. Currently, we're still using GLib as a backend.
2013-09-27OutputAll: add pure/const attributesMax Kellermann1-0/+1
2013-09-26MusicBuffer: expose the C++ APIMax Kellermann1-10/+9
2013-09-26MusicPipe: expose the C++ APIMax Kellermann1-19/+18
2013-09-05conf.h: remove obsolete headerMax Kellermann1-1/+3
Use only ConfigData.hxx in plugin sources to reduce header dependencies.
2013-09-04util/Error: new error passing libraryMax Kellermann1-11/+10
Replaces GLib's GError.
2013-08-07Makefile.am: move sources to libsystem.aMax Kellermann1-1/+1
2013-08-07FatalError: new library to replace mpd_error.hMax Kellermann1-6/+6
2013-08-04*: use gcc.h macros instead of GLibMax Kellermann1-1/+1
2013-08-04OutputPlugin: pass config_param referenceMax Kellermann1-3/+10
2013-08-03audio_format: convert to C++Max Kellermann1-10/+8
2013-04-17OutputInternal: use Mutex instead of GMutexMax Kellermann1-22/+12
2013-04-17output: convert to C++Max Kellermann1-5/+1
2013-01-20PlayerControl: move functions into the classMax Kellermann1-4/+4
2013-01-10notify: convert to C++Max Kellermann1-9/+2
2013-01-07decoder_api.h, ...: add "extern C"Max Kellermann1-1/+1
2013-01-07mixer_all: convert to C++Max Kellermann1-1/+1
2013-01-05filter/ReplayGain: add method _set_mode()Max Kellermann1-0/+7
Push the new mode to the filter instead of accessing global variables through replay_gain_get_real_mode().
2013-01-04player_control.h: convert header to C++Max Kellermann1-1/+1
2013-01-04MusicChunk: move functions to methodsMax Kellermann1-1/+1
2013-01-04buffer, pipe: convert to C++Max Kellermann1-7/+3
2013-01-04output_*: convert to C++Max Kellermann1-5/+12
2012-08-08output_all: add basic GError supportMax Kellermann1-4/+15
2011-09-19output_plugin: the plugin allocates the audio_output objectMax Kellermann1-24/+28
Pass audio_output objects around instead of void pointers. This will give some more control to the plugin, and prepares for non-blocking audio outputs.
2011-09-01output_all: move _lock_signal() to output_control.cMax Kellermann1-19/+3
Better name, better documentation.
2011-09-01output_thread: reimplement CANCEL synchronizationMax Kellermann1-2/+5
The output thread could hang indefinitely after finishing CANCEL, because it could have missed the signal while the output was not unlocked in ao_command_finished(). This patch removes the wait() call after CANCEL, and adds the flag "allow_play" instead. While this flag is set, playback is skipped. With this flag, there will not be any excess wait() call after the pipe has been cleared. This patch fixes a bug that causes mpd to discontinue playback after seeking, due to the race condition described above.
2011-01-29copyright year 2011Max Kellermann1-1/+1
2011-01-10include cleanupMax Kellermann1-0/+1
2011-01-10player_control: removed the global variable "pc"Max Kellermann1-7/+7
Allocate a player_control object where needed, and pass it around. Each "client" object is associated with a "player_control" instance. This prepares multi-player support.
2010-11-05pipe: add helper function music_pipe_empty()Max Kellermann1-2/+2
2010-10-05output_all: disable outputs on shutdownMax Kellermann1-0/+1
Call output_plugin.disable() before output_plugin.finish(). This ensures that all outputs are properly cleaned up, to make valgrind happy.
2010-09-28mpd_error: more correct MPD_ERROR implementationDenis Krjuchkov1-1/+1
Original implementation does not handle if (...) MPD_ERROR("die"); else ... case well. This change fixes handling of such cases.
2010-09-25eliminate g_error() usageThomas Jansen1-5/+6
Replaced all occurrences of g_error() with MPD_ERROR() located in a new header file 'mpd_error.h'. This macro uses g_critical() to print the error message and then exits gracefully in contrast to g_error() which would internally call abort() to produce a core dump. The macro name is distinctive and allows to find all places with dubious error handling. The long-term goal is to get rid of MPD_ERROR() altogether. To facilitate the eventual removal of this macro it was added in a new header file rather than to an existing header file. This fixes #2995 and #3007.
2010-03-10output: added option "always_on" for radio stationsMax Kellermann1-0/+23
Did you ever accidently click "stop" while feeding a radio station? This option sets the output device to "pause" to disable the "close" method. It falls back to "pause" then, which is specific to the plugin. Some plugins implement it by feeding silence.
2010-01-02output_all: reset elapsed_time at song borderMax Kellermann1-0/+8
Another quirk fixed: after the last chunk of a song has been played, the "elapsed_time" variable is set to the chunk's time stamp. When the client receives the PLAYER idle event and asks MPD for the current time stamp, MPD will return the last time stamp of the previous song when it hasn't played the first chunk of the current song yet.
2009-12-31Update copyright notices.Avuton Olrich1-1/+1
2009-11-12player_thread: initialize chunk->times in silence generatorMax Kellermann1-1/+4
When waiting for the decoder to provide more data, the player thread generates silence chunks if needed. However, it forgot to initialize the chunk.times attribute, which had now an undefined value. This patch sets it to -1.0, meaning "value is undefined". Add a ">= 0.0" check to audio_output_all_check(). This fixes spurious relative seeking errors, because sometimes, the "elapsed" value falls back to 0.0.
2009-11-12include config.h in all sourcesMax Kellermann1-0/+1
After we've been hit by Large File Support problems several times in the past week (which only occur on 32 bit platforms, which I don't have), this is yet another attempt to fix the issue.
2009-11-09output_thread: added command DRAINMax Kellermann1-0/+9
This command manually drains the hardware buffer. This is useful when the player thread want to make sure that everything has been played.
2009-11-07output_all: automatically attempt to re-enable failed outputsMax Kellermann1-0/+1
When an output's enable() method has failed, and playback starts, retry to enable it. Without this, the user may be confused, because he sees the device is "enabled" but cannot use it, and currently there is no error message in the log.
2009-11-02output: signal the output thread when CANCEL is finishedMax Kellermann1-0/+30
After CANCEL, the output thread waits for another signal before it continues playback, to synchronize with the caller. There were some situations where this signal wasn't sent properly. This patch adds an explicit g_cond_signal() at two code positions.
2009-10-31player_control: protect command, state, error with a mutexMax Kellermann1-2/+7
Use GMutex/GCond instead of the notify library. Manually lock the player_control object before accessing the protected attributes. Use the GCond object to notify the player thread and the main thread.
2009-10-30{player,output}_thread: fixed elapsed_time quirksMax Kellermann1-2/+5
Right after seeking and song change, the elapsed_time shows old information, because the output thread didn't finish a full chunk yet. This patch re-adds a second elapsed_time variable, and keeps track of a fallback value, in case the output thread can't provide a reliable value.
2009-10-29output: consistently lock audio output objectsMax Kellermann1-11/+15
Always keep the audio_output object locked within the output thread, unless a plugin method is called. This fixes several race conditions.
2009-10-23output_plugin: added methods enable() and disable()Max Kellermann1-0/+19
With these methods, an output plugin can allocate some global resources only if it is actually enabled. The method enable() is called after daemonization, which allows for more sophisticated resource allocation during that method.
2009-10-08player_thread: get "elapsed" from audio outputsMax Kellermann1-0/+14
Tracking the "elapsed" time from the chunks which we have sent to the output pipe is very imprecise: since we have implemented the music pipe, we're sending large number of chunks at once, giving the "elapsed" time stamp a resolution of usually more than a second. This patch changes the source of this information to the outputs. If a chunk has been played by all outputs, the "elapsed" time stamp is updated. The new command PLAYER_COMMAND_REFRESH makes the player thread update its status information: it tells the outputs to update the chunk time stamp. After that, player_control.elapsed_time is current.
2009-06-29output_all: don't resume playback when stopping during pauseMax Kellermann1-2/+0
When MPD was paused, and the client sent the "stop" command (or "clear"), a glitch caused MPD to continue playback for a split second. This was because audio_output_all_cancel() calls audio_output_all_update(), which reopens all output devices, and re-ignites the playback loop.
2009-05-29output_all: explicitly return "true" from audio_output_all_play()Max Kellermann1-1/+1
Instead of returning the local variable "ret" which is always true at this point, hard-code the "true" return value, because that might be more readable.
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.