Skip to content

Commit

Permalink
fix compatibility with packet encoders that give us strings as keys
Browse files Browse the repository at this point in the history
(which is what we want)
  • Loading branch information
totaam committed Aug 1, 2021
1 parent ffd449a commit 63b4557
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions xpra/server/source/encodings_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from xpra.codecs.video_helper import getVideoHelper
from xpra.codecs.codec_constants import video_spec
from xpra.net.compression import use
from xpra.os_util import monotonic_time, strtobytes
from xpra.os_util import monotonic_time, bytestostr
from xpra.server.background_worker import add_work_item
from xpra.util import csv, typedict, envint
from xpra.log import Logger
Expand Down Expand Up @@ -309,18 +309,18 @@ def parse_encoding_caps(self, c):
#2: standardized encoding options:
for k in c.keys():
#yaml gives us str..
k = strtobytes(k)
if k.startswith(b"theme.") or k.startswith(b"encoding.icons."):
self.icons_encoding_options[k.replace(b"encoding.icons.", b"").replace(b"theme.", b"")] = c.get(k)
elif k.startswith(b"encoding."):
stripped_k = k[len(b"encoding."):]
if stripped_k in (b"transparency",
b"rgb_zlib", b"rgb_lz4", b"rgb_lzo",
k = bytestostr(k)
if k.startswith("theme.") or k.startswith("encoding.icons."):
self.icons_encoding_options[k.replace("encoding.icons.", "").replace("theme.", "")] = c.get(k)
elif k.startswith("encoding."):
stripped_k = k[len("encoding."):]
if stripped_k in ("transparency",
"rgb_zlib", "rgb_lz4", "rgb_lzo",
):
v = c.boolget(k)
elif stripped_k in (b"initial_quality", b"initial_speed",
b"min-quality", b"quality",
b"min-speed", b"speed"):
elif stripped_k in ("initial_quality", "initial_speed",
"min-quality", "quality",
"min-speed", "speed"):
v = c.intget(k)
else:
v = c.get(k)
Expand Down

0 comments on commit 63b4557

Please sign in to comment.