aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/pulseaudio.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-04-27 13:39:46 -0700
committerChris Robinson <[email protected]>2019-04-27 14:13:07 -0700
commitc135629eae544b0e7785803b98987c1ab1eb95ca (patch)
tree661bc5cbc23bb718ebc17ec88de1b799decc9635 /Alc/backends/pulseaudio.cpp
parent150dc92f68bf10783344d81f57acff59aaf79369 (diff)
Remove some ancient PulseAudio KDE/Phonon/Qt hacks
Unfortuantely, the relevant KDE bug still seems to exist (streams are forced to KDE's default device after opening, even when they're created with a specific device at user request). I do not know why KDE thinks this is in any way good behavior (the user doesn't get their desired device, nor does the stream get the appropriate format for the device its ultimately put on), but making streams non-movable as a workaround has been a thorn in the side of non-KDE users for too long. C'mon KDE, it's been nearly (if not more than) 7 years now.
Diffstat (limited to 'Alc/backends/pulseaudio.cpp')
-rw-r--r--Alc/backends/pulseaudio.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/Alc/backends/pulseaudio.cpp b/Alc/backends/pulseaudio.cpp
index 58f075c8..55935423 100644
--- a/Alc/backends/pulseaudio.cpp
+++ b/Alc/backends/pulseaudio.cpp
@@ -190,8 +190,6 @@ inline pa_stream_flags_t& operator&=(pa_stream_flags_t &lhs, int rhs)
/* Global flags and properties */
pa_context_flags_t pulse_ctx_flags;
-pa_proplist *prop_filter;
-
pa_mainloop *pulse_mainloop{nullptr};
@@ -360,9 +358,8 @@ pa_stream *pulse_connect_stream(const char *device_name, std::unique_lock<std::m
pa_context *context, pa_stream_flags_t flags, pa_buffer_attr *attr, pa_sample_spec *spec,
pa_channel_map *chanmap, BackendType type)
{
- pa_stream *stream{pa_stream_new_with_proplist(context,
- (type==BackendType::Playback) ? "Playback Stream" : "Capture Stream", spec, chanmap,
- prop_filter)};
+ pa_stream *stream{pa_stream_new(context,
+ (type==BackendType::Playback) ? "Playback Stream" : "Capture Stream", spec, chanmap)};
if(!stream)
{
ERR("pa_stream_new_with_proplist() failed: %s\n", pa_strerror(pa_context_errno(context)));
@@ -769,7 +766,7 @@ ALCenum PulsePlayback::open(const ALCchar *name)
std::unique_lock<std::mutex> plock{pulse_lock};
pa_stream_flags_t flags{PA_STREAM_FIX_FORMAT | PA_STREAM_FIX_RATE | PA_STREAM_FIX_CHANNELS};
- if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", 0))
+ if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", 1))
flags |= PA_STREAM_DONT_MOVE;
pa_sample_spec spec{};
@@ -829,7 +826,7 @@ ALCboolean PulsePlayback::reset()
pa_stream_flags_t flags{PA_STREAM_START_CORKED | PA_STREAM_INTERPOLATE_TIMING |
PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_EARLY_REQUESTS};
- if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", 0))
+ if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", 1))
flags |= PA_STREAM_DONT_MOVE;
if(GetConfigValueBool(mDevice->DeviceName.c_str(), "pulse", "adjust-latency", 0))
{
@@ -1238,7 +1235,7 @@ ALCenum PulseCapture::open(const ALCchar *name)
mAttr.fragsize = minu(samples, 50*mDevice->Frequency/1000) * pa_frame_size(&mSpec);
pa_stream_flags_t flags{PA_STREAM_START_CORKED | PA_STREAM_ADJUST_LATENCY};
- if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", 0))
+ if(!GetConfigValueBool(nullptr, "pulse", "allow-moves", 1))
flags |= PA_STREAM_DONT_MOVE;
TRACE("Connecting to \"%s\"\n", pulse_name ? pulse_name : "(default)");
@@ -1489,15 +1486,6 @@ bool PulseBackendFactory::init()
pa_context *context{connect_context(plock, AL_TRUE)};
if(!context) return false;
- /* Some libraries (Phonon, Qt) set some pulseaudio properties through
- * environment variables, which causes all streams in the process to
- * inherit them. This attempts to filter those properties out by setting
- * them to 0-length data.
- */
- prop_filter = pa_proplist_new();
- pa_proplist_set(prop_filter, PA_PROP_MEDIA_ROLE, nullptr, 0);
- pa_proplist_set(prop_filter, "phonon.streamid", nullptr, 0);
-
pa_context_disconnect(context);
pa_context_unref(context);