Skip to content

Commit

Permalink
don't recycle the video context unnecessarily
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@20926 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 4, 2018
1 parent 0e1e73b commit 1bee9a2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/xpra/server/window/window_video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,18 @@ def update_encoding_options(self, force_reload=False):
ww, wh = self.window_dimensions
vs.identify_video_subregion(ww, wh, self.statistics.damage_events_count, self.statistics.last_damage_events, self.statistics.last_resized)
newrect = vs.rectangle
if newrect is None or old is None or newrect!=old:
self.cleanup_codecs()
if ((newrect is None) ^ (old is None)) or newrect!=old:
if old is None and newrect and newrect.get_geometry()==(0, 0, ww, wh):
#not actually changed!
#the region is the whole window
pass
elif newrect is None and old and old.get_geometry()==(0, 0, ww, wh):
#not actually changed!
#the region is the whole window
pass
else:
videolog("video subregion was %s, now %s (window size: %i,%i)", old, newrect, ww, wh)
self.cleanup_codecs()
if newrect:
#remove this from regular refresh:
if old is None or old!=newrect:
Expand Down

0 comments on commit 1bee9a2

Please sign in to comment.