Skip to content

Commit

Permalink
#669: make it easier to test overruns without changing the queue sett…
Browse files Browse the repository at this point in the history
…ings: add fake overruns via env var

git-svn-id: https://xpra.org/svn/Xpra/trunk@8956 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 7, 2015
1 parent 32ea33a commit 59fbb84
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/xpra/sound/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
DEBUG_SOUND = os.environ.get("XPRA_SOUND_DEBUG", "0")=="1"
SUBPROCESS_DEBUG = os.environ.get("XPRA_SOUND_SUBPROCESS_DEBUG", "").split(",")
EXPORT_INFO_TIME = int(os.environ.get("XPRA_SOUND_INFO_TIME", "1000"))
FAKE_OVERRUN = int(os.environ.get("XPRA_FAKE_OVERRUN", "0"))


#this wrapper takes care of launching src.py or sink.py
Expand Down Expand Up @@ -85,6 +86,10 @@ def __init__(self, *pipeline_args):
from xpra.sound.sink import SoundSink
sound_pipeline = SoundSink(*pipeline_args)
sound_subprocess.__init__(self, sound_pipeline, ["add_data"], ["underrun", "overrun"])
if FAKE_OVERRUN>0:
def fake_overrun(*args):
self.wrapped_object.emit("overrun", 500)
gobject.timeout_add(FAKE_OVERRUN*1000, fake_overrun)


def run_sound(mode, error_cb, options, args):
Expand Down

0 comments on commit 59fbb84

Please sign in to comment.