Go to file
Christophe Fergeau 4b15555fbd mjpeg: fix libjpeg assertion
After the changes to add libjpeg-turbo support to spice-server mjpeg
compression code, it's relatively easy to hit an assertion from
libjpeg in spice-server about "too few scanlines transferred" when
the mjpeg streaming code triggers. This assertion brings down qemu,
which is bad :)

This is because when we first initialize the mjpeg encoder, we do:

stream_width = SPICE_ALIGN(src_rect->right - src_rect->left, 2);
stream_height = SPICE_ALIGN(src_rect->bottom - src_rect->top, 2);

stream->mjpeg_encoder = mjpeg_encoder_new(stream_width, stream_height);

and then when we iterate over the image scanlines to feed them to
libjpeg, we do:

const int image_height = src->bottom - src->top;
const int image_width = src->right - src->left;

for (i = 0; i < image_height; i++) {
    mjpeg_encoder_encode_scanline(...);
}
mjpeg_encoder_end_frame(...);

When stream_height is odd, the mjpeg_encoder will be created with
an height that is 1 more than the number of lines we encode. Then
libjpeg asserts when we tell it we're done with the compression
while it's still waiting for one more scanline.

Looking through git history, this rounding seems to be an artifact
from when we were using ffmpeg for the mjpeg encoding. Since
spicec and spicy (the latter needs a few fixes) can handle streams
with odd height/width, the best way to solve this issue is to stop
rounding up the height and width of the streams we create. This
even saves some bandwidth :)
2011-08-01 11:01:04 +02:00
client client: fix 30s timeout regression 2011-07-31 13:32:28 +03:00
common common/backtrace.h: disable for WIN32 2011-07-31 13:31:58 +03:00
python_modules add check for pyparsing 2011-06-22 16:24:32 +02:00
server mjpeg: fix libjpeg assertion 2011-08-01 11:01:04 +02:00
tests tests/migrate: update to use argparse and run spicy by default 2011-07-05 14:24:41 +02:00
tools Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
uncrustify_cfg fresh start 2009-10-14 15:06:41 +02:00
.gitignore gitignore: add generated_*, vim temps, pyc 2010-11-08 16:06:55 +02:00
AUTHORS fresh start 2009-10-14 15:06:41 +02:00
autogen.sh autogen: exit upon errors (subdir config) 2010-03-24 14:03:51 +01:00
ChangeLog fresh start 2009-10-14 15:06:41 +02:00
configure.ac set version number to 0.9.0 2011-07-22 10:24:30 +02:00
COPYING Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
GITVERSION Add --enable-werror and make it the default only for git builds 2010-07-09 12:14:32 +02:00
Makefile.am add SASL and smartcard to distcheck flags 2011-07-22 10:24:30 +02:00
NEWS Release 0.9.0 2011-07-23 18:42:31 +03:00
README Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
spice1.proto spice-client migration: fix minor for old migration support. 2011-01-27 18:26:09 +02:00
spice_codegen.py don't #include config.h in generated header files 2011-06-22 16:29:52 +02:00
spice-server.pc.in Rename .so spice-server.so 2010-03-24 17:13:42 +01:00
spice.proto sndworker: add AudioVolume/AudioMute messages 2011-06-22 12:12:26 +02:00

Copyright 2009 Red Hat, Inc. and/or its affiliates.

This program and libraries is free software; you can redistribute it
and/or modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.