Merge branch 'origin/pixma_bug_fixes' into 'master'

General pixma backend fixes

See merge request sane-project/backends!548
escl-fix-sleep-mode
Povilas Kanapickas 2020-12-07 13:21:30 +00:00
commit bb84652c3c
1 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -1455,8 +1455,8 @@ static void
pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data,
SANE_Int max_length, SANE_Int *length)
{
struct jpeg_decompress_struct cinfo = ss->jpeg_cinfo;
pixma_jpeg_src_mgr *src = (pixma_jpeg_src_mgr *)ss->jpeg_cinfo.src;
struct jpeg_decompress_struct *cinfo = &ss->jpeg_cinfo;
pixma_jpeg_src_mgr *src = (pixma_jpeg_src_mgr *)cinfo->src;
int l;
@ -1476,7 +1476,7 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data,
return;
}
if (cinfo.output_scanline >= cinfo.output_height)
if (cinfo->output_scanline >= cinfo->output_height)
{
*length = 0;
return;
@ -1486,7 +1486,7 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data,
* only one line at time is supported
*/
l = jpeg_read_scanlines(&cinfo, ss->jdst->buffer, 1);
l = jpeg_read_scanlines(cinfo, ss->jdst->buffer, 1);
if (l == 0)
return;
@ -1494,7 +1494,7 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data,
* linebuffer holds width * bytesperpixel
*/
(*ss->jdst->put_pixel_rows)(&cinfo, ss->jdst, 1, (char *)src->linebuffer);
(*ss->jdst->put_pixel_rows)(cinfo, ss->jdst, 1, (char *)src->linebuffer);
*length = ss->sp.w * ss->sp.channels;
/* Convert RGB into grayscale */
@ -1527,9 +1527,9 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data,
b = (b << 1) | 0;
else
b = (b << 1) | 1;
if ((i % 8) == 0)
*(d++) = b;
}
if ((i % 8) == 0)
*(d++) = b;
}
src->linebuffer_size = *length;