Skip to content

Commit

Permalink
#400 fix some warnings found on osx:
Browse files Browse the repository at this point in the history
* add shared defaults for all sink (they all share the same base class)
* use this to set: sync=false, async=true for all sinks

git-svn-id: https://xpra.org/svn/Xpra/trunk@7757 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 23, 2014
1 parent c75d671 commit fe6d230
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/xpra/sound/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
if os.name=="posix":
SINKS += ["alsasink", "osssink", "oss4sink", "jackaudiosink"]

SINK_SHARED_DEFAULT_ATTRIBUTES = {"sync" : False,
"async" : True}
SINK_DEFAULT_ATTRIBUTES = {
"alsasink" : {"sync" : False},
"pulsesink" : {"client" : "Xpra"}
}

Expand Down Expand Up @@ -92,7 +93,9 @@ 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))
sink_str = plugin_str(sink_type, SINK_DEFAULT_ATTRIBUTES.get(sink_type))
sink_attributes = SINK_SHARED_DEFAULT_ATTRIBUTES.copy()
sink_attributes.update(SINK_DEFAULT_ATTRIBUTES.get(sink_type, {}))
sink_str = plugin_str(sink_type, sink_attributes)
pipeline_els.append(sink_str)
self.setup_pipeline_and_bus(pipeline_els)
self.src = self.pipeline.get_by_name("src")
Expand Down

0 comments on commit fe6d230

Please sign in to comment.