Skip to content

Commit

Permalink
add ability to easily add sink attributes and include two examples
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@7514 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 4, 2014
1 parent 2e2ade3 commit 58897eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/xpra/sound/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 58897eb

Please sign in to comment.