From 58897eb6a29a63fbc05ed7f48df7290dd01b08f6 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 4 Sep 2014 16:03:37 +0000 Subject: [PATCH] add ability to easily add sink attributes and include two examples git-svn-id: https://xpra.org/svn/Xpra/trunk@7514 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/sound/sink.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/xpra/sound/sink.py b/src/xpra/sound/sink.py index 7684a5230b..e9d135a35d 100755 --- a/src/xpra/sound/sink.py +++ b/src/xpra/sound/sink.py @@ -27,6 +27,11 @@ if os.name=="posix": SINKS += ["alsasink", "osssink", "oss4sink", "jackaudiosink"] +SINK_DEFAULT_ATTRIBUTES = { + "alsasink" : {"sync" : False}, + "pulsesink" : {"client" : "Xpra"} + } + GST_QUEUE_NO_LEAK = 0 GST_QUEUE_LEAK_UPSTREAM = 1 GST_QUEUE_LEAK_DOWNSTREAM = 2 @@ -87,7 +92,8 @@ def __init__(self, sink_type=DEFAULT_SINK, options={}, codec=MP3, decoder_option if QUEUE_SILENT: queue_el.append("silent=%s" % QUEUE_SILENT) pipeline_els.append(" ".join(queue_el)) - pipeline_els.append(sink_type) + sink_str = plugin_str(sink_type, SINK_DEFAULT_ATTRIBUTES.get(sink_type)) + pipeline_els.append(sink_str) self.setup_pipeline_and_bus(pipeline_els) self.src = self.pipeline.get_by_name("src") self.queue = self.pipeline.get_by_name("queue")