Skip to content

Commit

Permalink
fix race condition during window source cleanup: always copy referenc…
Browse files Browse the repository at this point in the history
…e to video helper before use

git-svn-id: https://xpra.org/svn/Xpra/trunk@11610 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jan 7, 2016
1 parent dfb262c commit 5ee0efc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/xpra/server/window/window_video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,13 +758,17 @@ def get_video_pipeline_options(self, encoding, width, height, src_format, force_
scorelog("get_video_pipeline_options%s using cached values from %ims ago", (encoding, width, height, src_format, force_refresh), 1000.0*(time.time()-self.last_pipeline_time))
return self.last_pipeline_scores

vh = self.video_helper
if vh is None:
return [] #closing down

#these are the CSC modes the client can handle for this encoding:
#we must check that the output csc mode for each encoder is one of those
supported_csc_modes = self.full_csc_modes.get(encoding)
if not supported_csc_modes:
scorelog("get_video_pipeline_options: no supported csc modes for %s", encoding)
return []
encoder_specs = self.video_helper.get_encoder_specs(encoding)
encoder_specs = vh.get_encoder_specs(encoding)
if not encoder_specs:
scorelog("get_video_pipeline_options: no encoder specs for %s", encoding)
return []
Expand Down Expand Up @@ -792,7 +796,7 @@ def add_scores(info, csc_spec, enc_in_format):
add_scores("direct (no csc)", None, src_format)

#now add those that require a csc step:
csc_specs = self.video_helper.get_csc_specs(src_format)
csc_specs = vh.get_csc_specs(src_format)
if csc_specs:
#log("%s can also be converted to %s using %s", pixel_format, [x[0] for x in csc_specs], set(x[1] for x in csc_specs))
#we have csc module(s) that can get us from pixel_format to out_csc:
Expand Down Expand Up @@ -1270,10 +1274,13 @@ def video_fallback():
videolog.warn("using '%s' as non-video fallback using %s", fallback_encoding, encode_fn)
return encode_fn(fallback_encoding, image, options)

vh = self.video_helper
if vh is None:
return None #shortcut when closing down
if not self.check_pipeline(encoding, w, h, src_format):
#just for diagnostics:
supported_csc_modes = self.full_csc_modes.get(encoding, [])
encoder_specs = self.video_helper.get_encoder_specs(encoding)
encoder_specs = vh.get_encoder_specs(encoding)
encoder_types = []
ecsc = []
for csc in supported_csc_modes:
Expand Down

0 comments on commit 5ee0efc

Please sign in to comment.