Skip to content

Commit

Permalink
only enable an encoding if we have an encoder for it
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Feb 16, 2023
1 parent 1f12618 commit d1495cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xpra/server/window/window_video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ def init_encoders(self):
self.non_video_encodings = ()
self.common_video_encodings = ()
return
self.video_encodings = tuple(x for x in self.video_helper.get_encodings() if x in self.server_core_encodings)
#make sure we actually have encoders for these:
enc_options = set(self.server_core_encodings) & set(self._encoders.keys())
self.video_encodings = tuple(x for x in self.video_helper.get_encodings() if x in enc_options)
video_enabled = []
for x in self.video_encodings:
self.append_encoder(x, self.video_encode)
Expand All @@ -152,7 +154,7 @@ def init_encoders(self):
self.add_encoder("auto", self.video_encode)
#these are used for non-video areas, ensure "jpeg" is used if available
#as we may be dealing with large areas still, and we want speed:
nv_common = (set(self.server_core_encodings) & set(self.core_encodings)) - set(self.video_encodings)
nv_common = (enc_options & set(self.core_encodings)) - set(self.video_encodings)
self.non_video_encodings = tuple(x for x in PREFERRED_ENCODING_ORDER
if x in nv_common)
self.common_video_encodings = tuple(x for x in PREFERRED_ENCODING_ORDER
Expand Down

0 comments on commit d1495cb

Please sign in to comment.