Start fixing for png-1.5. Small function left.
This commit is contained in:
parent
5a2bbff676
commit
3755e97d2f
3 changed files with 127 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: distinfo,v 1.8 2009/07/07 17:38:09 joerg Exp $
|
||||
$NetBSD: distinfo,v 1.9 2011/04/05 11:24:15 wiz Exp $
|
||||
|
||||
SHA1 (xvidcap-1.1.3.tar.gz) = e6d86a4184c8cc3e74738fb6e20d49c0d1640025
|
||||
RMD160 (xvidcap-1.1.3.tar.gz) = cc7be360153f192b502ffedc6548cce163a9154c
|
||||
|
@ -10,3 +10,5 @@ SHA1 (patch-ad) = ac40095849f721cfd8aa1e0143dff3ac9b705be7
|
|||
SHA1 (patch-ae) = 2ebab45421ab2782d48067f7b63e010190111397
|
||||
SHA1 (patch-af) = 7e5533775b68a2c2ade195660b859530e6422da4
|
||||
SHA1 (patch-ag) = 44cb7ad63e477f21b013a43d06ce81fddb235ef7
|
||||
SHA1 (patch-src_xtomng.c) = 474b082c94883fd367126e6835e91bfc856063b5
|
||||
SHA1 (patch-src_xtopng.c) = 5e4e8e7150ccb67e25a65ecf33e2900074fa1179
|
||||
|
|
60
x11/xvidcap/patches/patch-src_xtomng.c
Normal file
60
x11/xvidcap/patches/patch-src_xtomng.c
Normal file
|
@ -0,0 +1,60 @@
|
|||
$NetBSD: patch-src_xtomng.c,v 1.1 2011/04/05 11:24:16 wiz Exp $
|
||||
|
||||
Fix build with png-1.5.
|
||||
|
||||
--- src/xtomng.c.orig 2004-02-14 10:55:36.000000000 +0000
|
||||
+++ src/xtomng.c
|
||||
@@ -110,19 +110,18 @@ XImageToMNGC (FILE *fp, XImage *image, J
|
||||
png_destroy_write_struct (&png_ptr, (png_infopp)NULL);
|
||||
return;
|
||||
}
|
||||
- if (setjmp (png_ptr->jmpbuf)) {
|
||||
+ if (setjmp (png_jmpbuf(png_ptr))) {
|
||||
png_destroy_write_struct (&png_ptr, &info_ptr);
|
||||
(*job->close) (fp);
|
||||
exit(99);
|
||||
}
|
||||
|
||||
- info_ptr->width = image->width;
|
||||
- info_ptr->height= image->height;
|
||||
- info_ptr->bit_depth = 8;
|
||||
- info_ptr->color_type = PNG_COLOR_TYPE_RGB;
|
||||
- if (image->bits_per_pixel != 24) {
|
||||
- info_ptr->color_type |= PNG_COLOR_MASK_COLOR;
|
||||
- }
|
||||
+ png_set_IHDR(png_ptr, info_ptr, image->width,
|
||||
+ image->height, 8, image->bits_per_pixel
|
||||
+ != 24 ? PNG_COLOR_TYPE_RGB |
|
||||
+ PNG_COLOR_MASK_COLOR : PNG_COLOR_TYPE_RGB,
|
||||
+ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE,
|
||||
+ PNG_FILTER_TYPE_BASE);
|
||||
mng_write_sig (png_ptr);
|
||||
mng_write_MHDR (png_ptr, image->width, image->height, 1000 /* msec */);
|
||||
mng_write_nEED (png_ptr, "draft 41");
|
||||
@@ -354,19 +353,17 @@ XImageToMNG8 (FILE *fp, XImage *image, J
|
||||
png_destroy_write_struct (&png_ptr, (png_infopp)NULL);
|
||||
return;
|
||||
}
|
||||
- if (setjmp (png_ptr->jmpbuf)) {
|
||||
+ if (setjmp (png_jmpbuf(png_ptr))) {
|
||||
png_destroy_write_struct (&png_ptr, &info_ptr);
|
||||
(*job->close)(fp);
|
||||
exit (99);
|
||||
}
|
||||
- info_ptr->width = image->width;
|
||||
- info_ptr->height= image->height;
|
||||
- info_ptr->bit_depth = 8;
|
||||
- if (job->win_attr.visual->class == StaticGray) {
|
||||
- info_ptr->color_type = PNG_COLOR_TYPE_GRAY;
|
||||
- } else {
|
||||
- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
|
||||
- }
|
||||
+ png_set_IHDR(png_ptr, info_ptr, image->width,
|
||||
+ image->height, 8, job->win_attr.visual->class
|
||||
+ == StaticGray ? PNG_COLOR_TYPE_GRAY
|
||||
+ : PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE,
|
||||
+ PNG_COMPRESSION_TYPE_BASE,
|
||||
+ PNG_FILTER_TYPE_BASE);
|
||||
mng_write_sig (png_ptr),
|
||||
mng_write_MHDR (png_ptr, image->width, image->height, 1000 /* msec */);
|
||||
mng_write_nEED (png_ptr, "draft 41");
|
64
x11/xvidcap/patches/patch-src_xtopng.c
Normal file
64
x11/xvidcap/patches/patch-src_xtopng.c
Normal file
|
@ -0,0 +1,64 @@
|
|||
$NetBSD: patch-src_xtopng.c,v 1.1 2011/04/05 11:24:16 wiz Exp $
|
||||
|
||||
Fix build with png-1.5.
|
||||
|
||||
--- src/xtopng.c.orig 2004-02-14 10:55:36.000000000 +0000
|
||||
+++ src/xtopng.c
|
||||
@@ -110,7 +110,7 @@ XImageToPNGC (FILE *fp, XImage *image, J
|
||||
png_destroy_write_struct (&png_ptr, (png_infopp)NULL);
|
||||
return;
|
||||
}
|
||||
- if (setjmp (png_ptr->jmpbuf)) {
|
||||
+ if (setjmp (png_jmpbuf(png_ptr))) {
|
||||
png_destroy_write_struct (&png_ptr, &info_ptr);
|
||||
(*job->close) (fp);
|
||||
return;
|
||||
@@ -119,13 +119,14 @@ XImageToPNGC (FILE *fp, XImage *image, J
|
||||
png_init_io (png_ptr, fp);
|
||||
png_set_compression_level (png_ptr, job->compress);
|
||||
|
||||
- info_ptr->width = image->width;
|
||||
- info_ptr->height= image->height;
|
||||
- info_ptr->bit_depth = 8;
|
||||
- info_ptr->color_type = PNG_COLOR_TYPE_RGB;
|
||||
+ png_set_IHDR(png_ptr, info_ptr, image->width,
|
||||
+ image->height, 8, ((image->bits_per_pixel ==
|
||||
+ 24) || (image->bits_per_pixel == 8)) ?
|
||||
+ PNG_COLOR_TYPE_RGB | PNG_COLOR_MASK_COLOR :
|
||||
+ PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
|
||||
+ PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
|
||||
if ((image->bits_per_pixel == 16) ||
|
||||
(image->bits_per_pixel == 8)) {
|
||||
- info_ptr->color_type |= PNG_COLOR_MASK_COLOR;
|
||||
/* may be we need this? seems to be so
|
||||
*/
|
||||
png_set_sBIT (png_ptr, info_ptr, &sig_bit);
|
||||
@@ -254,7 +255,7 @@ XImageToPNG8 (FILE *fp, XImage *image, J
|
||||
png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
|
||||
return;
|
||||
}
|
||||
- if (setjmp (png_ptr->jmpbuf)) {
|
||||
+ if (setjmp (png_jmpbuf(png_ptr))) {
|
||||
png_destroy_write_struct (&png_ptr, &info_ptr);
|
||||
(*job->close) (fp);
|
||||
return;
|
||||
@@ -263,13 +264,12 @@ XImageToPNG8 (FILE *fp, XImage *image, J
|
||||
png_init_io (png_ptr, fp);
|
||||
png_set_compression_level (png_ptr, job->compress);
|
||||
|
||||
- info_ptr->width = image->width;
|
||||
- info_ptr->height= image->height;
|
||||
- info_ptr->bit_depth = 8;
|
||||
- if (job->win_attr.visual->class == StaticGray) {
|
||||
- info_ptr->color_type = PNG_COLOR_TYPE_GRAY;
|
||||
- } else {
|
||||
- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
|
||||
+ png_set_IHDR(png_ptr, info_ptr, image->width,
|
||||
+ image->height, 8, job->win_attr.visual->class
|
||||
+ == StaticGray ? PNG_COLOR_TYPE_GRAY :
|
||||
+ PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE,
|
||||
+ PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
|
||||
+ if (job->win_attr.visual->class != StaticGray) {
|
||||
png_set_PLTE (png_ptr, info_ptr, job->color_table, job->ncolors);
|
||||
}
|
||||
|
Loading…
Reference in a new issue