| Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
-fixes regression introduced by:
'8d6fedf8177d0d2ced81e6d93d35c368b2ac69db [PATCH] Mixer: add class MixerListener'
-listener.OnMixerVolumeChanged() called GetVolume() which attempted to acquire
the lock but as per 'pa_threaded_mainloop_lock()' documentation:
This function may not be called inside the event loop thread. Events that are
dispatched from the event loop thread are executed with this lock held
-this patch seperates the underlying action of GetVolume() into a new
GetVolumeInternal() function, to be called only when the lock is already held, as
is the case for the listener.OnMixerVolumeChanged() call
|
|
Use a listener interface instead of GlobalEvents.
|
|
Passing a void pointer is unsafe.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Prepare to migrate away from GLib. Currently, we're still using GLib
as a backend.
|
|
Use only ConfigData.hxx in plugin sources to reduce header
dependencies.
|
|
Replaces GLib's GError.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Provide _lock() and _unlock() to wrap all accesses from the mixer
plugin.
|
|
|
|
|
|
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.
|
|
Don't let the mixer plugin "override" the libpulse callbacks.
Instead, add a "mixer" attribute to the pulse_output struct, and call
the mixer on all interesting events.
|
|
Moved the check from pulse_mixer_open() to pulse_mixer_update().
|
|
This is a complete rewrite of the PulseAudio output plugin. It uses
the asynchronous API, which gives us more control over everything.
Additionally, it connects to the PulseAudio server on startup, and
keeps this connection up while MPD runs. During pause, instead of
closing the stream, it enables "cork".
|
|
This allows the mixer object to access its associated audio output
object.
|
|
|
|
|
|
Using two different kinds of locks may result in a race condition with
a deadlock. The libpulse callbacks need no locks at all, because the
mainloop object can be assumed to be already locked.
|
|
There are numerous race conditions between the libpulse thread
(pulse_mixer.c callbacks) and the rest of MPD. Protect the volatile
attributes of the pulse_mixer struct with a mutex to fix that.
|
|
Eliminate one indent level. Also remove several debug useless debug
messages.
|
|
Those parameters are used after all.
|
|
Don't mess with pulse_mixer.volume for setting the volume. This
variable should only be used to transfer the current volume from
sink_input_vol() to pulse_mixer_get_volume().
|
|
The pa_context_get_sink_input_info() function is asynchronous, and
after it returns, libpulse does not guarantee that the operation has
completed yet; in fact, it is not likely. Explicitly wait for the
operation to complete.
The code for the new pulse_wait_for_operation() function was inspired
by mplayer and xine code.
|
|
Use the same code style as the rest of MPD.
|
|
Don't initialize attributes which are only used in an open mixer. As
long as nobody accesses them, their values are uninitialized and
undefined.
|
|
The pm->volume attribute was allocated in pulse_mixer_init(), but is
never freed. This leaks memory. Instead of adding the g_free() call
to pulse_mixer_finish(), let's just make "volume" a static attribute
of the pulse_mixer struct. That is easier to deal with.
|
|
When the MPD core knows that the pulse mixer is open, pm->mainloop and
pm->context must be non-NULL.
|
|
The attributes "online" and "index" were not properly reinitialized
after a close/open cycle.
|
|
Nobody needs to modify these strings. We can make them const, and
convert config_dup_block_string() to config_get_block_string(). This
also fixes memory leaks in the pulse mixer.
|
|
The conf.h functions deal well with config_param==NULL and will return
the specified default value then.
|
|
When the mixer initialization fails, we have to free the libpulse
objects we have already created, to prevent resource leaks.
|