Mercurial > hg > Applications > TreeVNC
changeset 565:2a601e25ce10
debug fix
author | riono |
---|---|
date | Mon, 03 Feb 2020 17:33:27 +0900 |
parents | 0751cb6c0715 |
children | e93a8058344d |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java |
diffstat | 2 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Mon Feb 03 16:38:51 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Mon Feb 03 17:33:27 2020 +0900 @@ -160,7 +160,8 @@ int output = deflater.deflate(c1, Deflater.NO_FLUSH); if (output==0 && ! deflater.needsInput() ) { // compression failed - deflater.finish(); + deflater.setInput(bytes, prevoffset, 0); + output = deflater.deflate(c1, Deflater.FULL_FLUSH); flushRectangle(rect); flushMuticast(rfb); if (!last) { @@ -173,6 +174,7 @@ } return ; } + deflater.deflate(c1); prevoffset = offset; width += tileW; if (c1rect.x > rect.x) { // phase 0
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Mon Feb 03 16:38:51 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Mon Feb 03 17:33:27 2020 +0900 @@ -383,10 +383,14 @@ if (in.readByte() != FRAMEBUFFER_UPDATE) { ; } - rect.fill(in); - Decoder decoder = decoders.getDecoderByType(rect.getEncodingType()); - decoder.decode(in,new NullRenderer(context.getPixelFormat().bitsPerPixel/8),rect); - } catch (Exception e) { + in.readByte(); + int numberOfRectangeles = in.readInt16(); + while (numberOfRectangeles-- > 0) { + rect.fill(in); + Decoder decoder = decoders.getDecoderByType(rect.getEncodingType()); + decoder.decode(in,new NullRenderer(context.getPixelFormat().bitsPerPixel/8),rect); + } + } catch (Exception e) { ; } }