Skip to content

Commit

Permalink
clamp the dimensions used for calculating the minimum pixels threshol…
Browse files Browse the repository at this point in the history
…d so large windows with small video areas will still use the video encoding

git-svn-id: https://xpra.org/svn/Xpra/trunk@13049 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jul 20, 2016
1 parent 6fd0edd commit 3fed36d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/xpra/server/window/window_video_source.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf8
# This file is part of Xpra.
# Copyright (C) 2013-2015 Antoine Martin <[email protected]>
# Copyright (C) 2013-2016 Antoine Martin <[email protected]>
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
# later version. See the file COPYING for details.

Expand Down Expand Up @@ -374,8 +374,8 @@ def lossless(reason):
lde = list(self.statistics.last_damage_events)
lim = now-2
pixels_last_2secs = sum(w*h for when,_,_,w,h in lde if when>lim)
if pixels_last_2secs<5*cww*cwh:
#less than 5 full window pixels in last 2 seconds
if pixels_last_2secs<5*min(640*480, cww*cwh):
#less than 5 480p frames / full window updates in last 2 seconds
return nonvideo()

if self._current_quality!=quality or self._current_speed!=speed:
Expand Down

0 comments on commit 3fed36d

Please sign in to comment.