Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* cutter with opus+muxer fails, so blacklist that
* opus alone does work, so bump it up the list

git-svn-id: https://xpra.org/svn/Xpra/trunk@16832 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 12, 2017
1 parent 84fd0c0 commit 256b177
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/xpra/sound/gstreamer_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ def force_enabled(codec_name):
#those don't work anyway:
CUTTER_NEEDS_CONVERT = ("vorbisenc", "wavpackenc", "avenc_aac")
ENCODER_CANNOT_USE_CUTTER = ("vorbisenc", "wavpackenc", "avenc_aac")
CODEC_CANNOT_USE_CUTTER = ("opus+mka", "opus+ogg")


#options we use to tune for low latency:
OGG_DELAY = 20*MS_TO_NS
Expand Down Expand Up @@ -198,7 +200,7 @@ def force_enabled(codec_name):
SPEEX : 0,
}

CODEC_ORDER = [MP3, OPUS_OGG, VORBIS_MKA, VORBIS_OGG, VORBIS, FLAC_OGG, AAC_MPEG4, WAV_LZ4, WAV_LZO, WAV, WAVPACK, SPEEX_OGG, OPUS, VORBIS, OPUS_MKA, FLAC, MP3_MPEG4]
CODEC_ORDER = [OPUS, OPUS_OGG, VORBIS_MKA, VORBIS_OGG, VORBIS, MP3, FLAC_OGG, AAC_MPEG4, WAV_LZ4, WAV_LZO, WAV, WAVPACK, SPEEX_OGG, VORBIS, OPUS_MKA, FLAC, MP3_MPEG4]


gst = None
Expand Down
4 changes: 2 additions & 2 deletions src/xpra/sound/src.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from xpra.sound.sound_pipeline import SoundPipeline
from xpra.gtk_common.gobject_util import n_arg_signal, gobject
from xpra.sound.gstreamer_util import get_source_plugins, plugin_str, get_encoder_elements, get_encoder_default_options, normv, get_encoders, get_queue_time, has_plugins, \
MP3, CODEC_ORDER, MUXER_DEFAULT_OPTIONS, ENCODER_NEEDS_AUDIOCONVERT, SOURCE_NEEDS_AUDIOCONVERT, ENCODER_CANNOT_USE_CUTTER, CUTTER_NEEDS_CONVERT, CUTTER_NEEDS_RESAMPLE, MS_TO_NS, GST_QUEUE_LEAK_DOWNSTREAM
MP3, CODEC_ORDER, MUXER_DEFAULT_OPTIONS, ENCODER_NEEDS_AUDIOCONVERT, SOURCE_NEEDS_AUDIOCONVERT, ENCODER_CANNOT_USE_CUTTER, CODEC_CANNOT_USE_CUTTER, CUTTER_NEEDS_CONVERT, CUTTER_NEEDS_RESAMPLE, MS_TO_NS, GST_QUEUE_LEAK_DOWNSTREAM
from xpra.net.compression import compressed_wrapper
from xpra.scripts.config import InitExit
from xpra.log import Logger
Expand Down Expand Up @@ -106,7 +106,7 @@ def __init__(self, src_type=None, src_options={}, codecs=get_encoders(), codec_o
pipeline_els += [" ".join(queue_el)]
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:
if CUTTER_THRESHOLD>0 and encoder not in ENCODER_CANNOT_USE_CUTTER and codec not in CODEC_CANNOT_USE_CUTTER:
pipeline_els.append("cutter threshold=%.4f leaky=false name=cutter" % CUTTER_THRESHOLD)
if encoder in CUTTER_NEEDS_CONVERT:
pipeline_els.append("audioconvert")
Expand Down

0 comments on commit 256b177

Please sign in to comment.