Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* lower the threshold
* increase the default "run-length" so don't stop and start all the time - use env var XPRA_CUTTER_RUN_LENGTH to tune it
* set the "pre-length" so we will send the buffers just before the volume is raised

git-svn-id: https://xpra.org/svn/Xpra/trunk@17285 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 2, 2017
1 parent d46fb1f commit f1ae321
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/xpra/sound/src.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
BUNDLE_METADATA = envbool("XPRA_SOUND_BUNDLE_METADATA", True)
LOG_CUTTER = envbool("XPRA_SOUND_LOG_CUTTER", False)
SAVE_TO_FILE = os.environ.get("XPRA_SAVE_TO_FILE")
CUTTER_THRESHOLD = envfloat("XPRA_CUTTER_THRESHOLD", "0.001")
CUTTER_THRESHOLD = envfloat("XPRA_CUTTER_THRESHOLD", "0.0001")
CUTTER_PRE_LENGTH = envint("XPRA_CUTTER_PRE_LENGTH", 100)
CUTTER_RUN_LENGTH = envint("XPRA_CUTTER_RUN_LENGTH", 1000)

generation = AtomicInteger()

Expand Down Expand Up @@ -105,7 +107,7 @@ def __init__(self, src_type=None, src_options={}, codecs=get_encoders(), codec_o
if encoder in ENCODER_NEEDS_AUDIOCONVERT or src_type in SOURCE_NEEDS_AUDIOCONVERT:
pipeline_els += ["audioconvert"]
if CUTTER_THRESHOLD>0 and encoder not in ENCODER_CANNOT_USE_CUTTER and not fmt:
pipeline_els.append("cutter threshold=%.4f leaky=false name=cutter" % CUTTER_THRESHOLD)
pipeline_els.append("cutter threshold=%.4f run-length=%i pre-length=%i leaky=false name=cutter" % (CUTTER_THRESHOLD, CUTTER_RUN_LENGTH*MS_TO_NS, CUTTER_PRE_LENGTH*MS_TO_NS))
if encoder in CUTTER_NEEDS_CONVERT:
pipeline_els.append("audioconvert")
if encoder in CUTTER_NEEDS_RESAMPLE:
Expand Down

0 comments on commit f1ae321

Please sign in to comment.