Skip to content

Commit

Permalink
safer and cheap to always audioconvert
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Dec 19, 2022
1 parent c952c11 commit 3e956ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions xpra/sound/gstreamer_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ def force_enabled(codec_name):


#these encoders require an "audioconvert" element:
ENCODER_NEEDS_AUDIOCONVERT = ("flacenc", "wavpackenc")
#ENCODER_NEEDS_AUDIOCONVERT = ("flacenc", "wavpackenc")
#if this is lightweight enough, maybe we should include it unconditionally?
SOURCE_NEEDS_AUDIOCONVERT = ("directsoundsrc", "osxaudiosrc", "autoaudiosrc", "wasapisrc")
#SOURCE_NEEDS_AUDIOCONVERT = ("directsoundsrc", "osxaudiosrc", "autoaudiosrc", "wasapisrc")

CUTTER_NEEDS_RESAMPLE = ("opusenc", )
#those don't work anyway:
Expand Down
4 changes: 2 additions & 2 deletions xpra/sound/src.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def __init__(self, src_type=None, src_options=None, codecs=(), codec_options=Non
f"max-size-time={SOURCE_QUEUE_TIME*MS_TO_NS}",
f"leaky={GST_QUEUE_LEAK_DOWNSTREAM}"]
pipeline_els += [" ".join(queue_el)]
if encoder in ENCODER_NEEDS_AUDIOCONVERT or src_type in SOURCE_NEEDS_AUDIOCONVERT:
pipeline_els += ["audioconvert"]
#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 run-length=%i pre-length=%i leaky=false name=cutter" % (
CUTTER_THRESHOLD, CUTTER_RUN_LENGTH*MS_TO_NS, CUTTER_PRE_LENGTH*MS_TO_NS))
Expand Down

0 comments on commit 3e956ee

Please sign in to comment.