diff options
author | 2012-01-28 16:58:46 +0000 | |
---|---|---|
committer | 2012-01-28 16:58:46 +0000 | |
commit | 905f0804af1ab052130ab7473034c5ef5509b2ca (patch) | |
tree | 97ced424a718b1db91dab135e4ee301977cd1876 | |
parent | Updated to xbmc-11.0_beta2 (diff) | |
download | jamesbroadhead-905f0804af1ab052130ab7473034c5ef5509b2ca.tar.gz jamesbroadhead-905f0804af1ab052130ab7473034c5ef5509b2ca.tar.bz2 jamesbroadhead-905f0804af1ab052130ab7473034c5ef5509b2ca.zip |
Switch to zenkaibo\'s github libpng1.5 patch
-rw-r--r-- | media-tv/xbmc/Manifest | 5 | ||||
-rw-r--r-- | media-tv/xbmc/files/xbmc-11.0_beta1-libpng-1.5-fix-plt-trn-get.patch | 51 | ||||
-rw-r--r-- | media-tv/xbmc/files/xbmc-11.0_beta1-libpng-1.5-headers.patch | 12 | ||||
-rw-r--r-- | media-tv/xbmc/files/xbmc-11.0_beta2-libpng1.5-zenkibou-github.patch (renamed from media-tv/xbmc/files/xbmc-11.0_beta1-libpng-1.5.patch) | 468 | ||||
-rw-r--r-- | media-tv/xbmc/xbmc-11.0_beta2.ebuild | 7 |
5 files changed, 248 insertions, 295 deletions
diff --git a/media-tv/xbmc/Manifest b/media-tv/xbmc/Manifest index c6e41fa..c7b32ad 100644 --- a/media-tv/xbmc/Manifest +++ b/media-tv/xbmc/Manifest @@ -1,4 +1,3 @@ -AUX 1 18994 RMD160 00fed60110f7b6e917bf813b4c08dff6534765cf SHA1 7e90064f04a4778cfe08509504fca39b6532b081 SHA256 b4ac0d0ca9a0869189b8eab523d9b8b99024c2d6b61974f43f6a06f6f876fc6a AUX xbmc-10.0-python-2.7.patch 30308 RMD160 15f01d93b0db903eadb5deb94d5092b0a4b68de4 SHA1 4f6da8045b575a80fd7d556c5b1f2fbbe2bc2da4 SHA256 8f6b2a0a962ad250fc317542d0fa180585d3c9e630ca98f99299b6f750555085 AUX xbmc-10.1-gcc-4.6.patch 4295 RMD160 4aee4c91f9d2f9e947d37cd39f2700fc0eaec353 SHA1 5ae755b20e06560aaf1508b80c1f7661ef36802f SHA256 cef1154bc3352b215bfece1a749d901d43ec7aa0c6d050921ae8745c553e84c9 AUX xbmc-10.1-headers.patch 294 RMD160 74536be4a5e3b939c6360bbc715f30e08226af46 SHA1 2435642148ec291d10bded3036592a6104f5ff03 SHA256 8b8e86cf7edef227e8267c52d60545b753eea11261f078131ee30f9eac8bb002 @@ -6,8 +5,8 @@ AUX xbmc-10.1-libpng-1.5.patch 19253 RMD160 1488504816e668fceb1c3f762738864ea81f AUX xbmc-11.0_beta1-libpng-1.5-fix-plt-trn-get.patch 1659 RMD160 94404f801cc50f0f83f6d9716b572568981cc238 SHA1 761e00902f9979180966928719ea2ba311ab590b SHA256 fed3ba39de959c46bc43431b229347c187690848ccd3bdc823bb7291bc425e84 AUX xbmc-11.0_beta1-libpng-1.5-headers.patch 450 RMD160 52f5b4974c2e593c3d6518638c81946a9dc325f2 SHA1 e1987cea85f3156b0f00c61d6411e678416df5f3 SHA256 28765af28836502ce2df92c00b0df27733137111f7fbb11a5cd0b5b7c47b0713 AUX xbmc-11.0_beta1-libpng-1.5.patch 18687 RMD160 806918123b89ba86dd548cbd42fe26f9784ca6b9 SHA1 44d8c0f96445db48293f356909cff303b050e279 SHA256 359cc4893cc6922b86269770c11c5e80fd5b33e711ebf1645b232e4f3fc91c28 -AUX xbmc-11.0_beta2-libpng-1.5-merged.patch 20467 RMD160 c64118241a9f897b9d3cde2ecf3cf9b8e8a26693 SHA1 821d1f3c90d8355db674c051b8f8da7235926911 SHA256 d4ac6cda6f4a0315eb00c709aa8982cac20c060068d2253e34d0f53f4423b17d +AUX xbmc-11.0_beta2-libpng1.5-zenkibou-github.patch 19397 RMD160 9713ef4f233a7790fe143157e1cb08f05a186433 SHA1 a82050f8bab6bcd2dc8ab9f44f39a0507dbf00d9 SHA256 ec14123fe568746b4b16f8d7dde4b4c4b4db3a07ea20273e1fea64604fd6d23c DIST xbmc-11.0-Eden_beta2.tar.gz 56577092 RMD160 4970a097a5a939bcc5d2d120b0d01ed4b95cb828 SHA1 1da6a2e1194bd4ed7e1e04ffccd0b5f92c40e734 SHA256 1f87e04b0444bb3587f055ae1b9d86e3f2fbf4284caeab8bc393e36e0e4c2ec6 -EBUILD xbmc-11.0_beta2.ebuild 5531 RMD160 1ca68ebd7ef722d12ff4f389d5c7b834d502b365 SHA1 d86db1b6140d0330c4a700f3bac3b6e7bc274db8 SHA256 4e9c6fd2ff468c857af53a2ff94343c0b5a8354a0a1a49bdcae1e6b4711f2b44 +EBUILD xbmc-11.0_beta2.ebuild 5399 RMD160 2a6e13e895946bb1fab23672581160e31ce13c3c SHA1 5939fca2ca4453b4508b25ee0d7b137f60396e00 SHA256 b7fbe01d75a3f7caf8bba1aea3d5c97d32c6dbdc253eb0189784ebdcd03cf8fc MISC ChangeLog 16667 RMD160 3b640cf19348af77f56e84b58c93ed39ee1720f2 SHA1 14f559e02386b8f2813143660a459bce3e4e7ef5 SHA256 9e508644e3a058e58f171207024340115fc8c0028a083281318df9376a9ea217 MISC metadata.xml 885 RMD160 67687f56afd352af492d990c0d1f0b35e08c16bc SHA1 6e4782708b211b5b45d039c633e14b324f0d3805 SHA256 8a5abffe9692e42653163891290a3f48c1ae68d73597b56e3fcc8ee60ee22c2b diff --git a/media-tv/xbmc/files/xbmc-11.0_beta1-libpng-1.5-fix-plt-trn-get.patch b/media-tv/xbmc/files/xbmc-11.0_beta1-libpng-1.5-fix-plt-trn-get.patch deleted file mode 100644 index 7e6ce67..0000000 --- a/media-tv/xbmc/files/xbmc-11.0_beta1-libpng-1.5-fix-plt-trn-get.patch +++ /dev/null @@ -1,51 +0,0 @@ - -Update libpng 1.5 patch: check return values of png_get_PLTE() and -png_get_tRNS() before using the values to avoid using uninitialized values. - ---- a/lib/cximage-6.0/CxImage/ximapng.cpp -+++ b/lib/cximage-6.0/CxImage/ximapng.cpp -@@ -178,12 +178,14 @@ bool CxImagePNG::Decode(CxFile *hFile) - int _num_palette; - png_colorp _palette; - #if PNG_LIBPNG_VER > 10399 -- png_get_PLTE(png_ptr,info_ptr,&_palette,&_num_palette); -+ png_uint_32 _palette_ret; -+ _palette_ret = png_get_PLTE(png_ptr,info_ptr,&_palette,&_num_palette); -+ if (_palette_ret && _num_palette>0){ - #else - _num_palette=info_ptr->num_palette; - _palette=info_ptr->palette; --#endif - if (_num_palette>0){ -+#endif - SetPalette((rgb_color*)_palette,_num_palette); - SetClrImportant(_num_palette); - } else if (_bit_depth ==2) { //<DP> needed for 2 bpp grayscale PNGs -@@ -199,11 +201,13 @@ bool CxImagePNG::Decode(CxFile *hFile) - int _num_trans; - png_color_16p _trans_color; - #if PNG_LIBPNG_VER > 10399 -- png_get_tRNS(png_ptr,info_ptr,&_trans_alpha,&_num_trans,&_trans_color); -+ png_uint_32 _trans_ret; -+ _trans_ret = png_get_tRNS(png_ptr,info_ptr,&_trans_alpha,&_num_trans,&_trans_color); -+ if (_trans_ret && _num_trans!=0){ //palette transparency - #else - _num_trans=info_ptr->num_trans; --#endif - if (_num_trans!=0){ //palette transparency -+#endif - if (_num_trans==1){ - if (_color_type == PNG_COLOR_TYPE_PALETTE){ - #if PNG_LIBPNG_VER > 10399 -@@ -219,7 +223,11 @@ bool CxImagePNG::Decode(CxFile *hFile) - #endif - } - } -+#if PNG_LIBPNG_VER > 10399 -+ if (_num_trans>1 && _trans_alpha!=NULL){ -+#else - if (_num_trans>1){ -+#endif - RGBQUAD* pal=GetPalette(); - if (pal){ - DWORD ip; diff --git a/media-tv/xbmc/files/xbmc-11.0_beta1-libpng-1.5-headers.patch b/media-tv/xbmc/files/xbmc-11.0_beta1-libpng-1.5-headers.patch deleted file mode 100644 index 4648f9f..0000000 --- a/media-tv/xbmc/files/xbmc-11.0_beta1-libpng-1.5-headers.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/tools/TexturePacker/XBTFWriter.cpp b/tools/TexturePacker/XBTFWriter.cpp -index 78b47fe..2e75d96 100644 ---- a/tools/TexturePacker/XBTFWriter.cpp -+++ b/tools/TexturePacker/XBTFWriter.cpp -@@ -22,6 +22,7 @@ - #include "XBTFWriter.h" - #define __STDC_FORMAT_MACROS - #include <inttypes.h> -+#include <unistd.h> /* for unlink() prototype */ - #include "guilib/XBTF.h" - #include "utils/EndianSwap.h" - #if !defined(__APPLE__) && !defined(__FreeBSD__) diff --git a/media-tv/xbmc/files/xbmc-11.0_beta1-libpng-1.5.patch b/media-tv/xbmc/files/xbmc-11.0_beta2-libpng1.5-zenkibou-github.patch index da331d2..c065a57 100644 --- a/media-tv/xbmc/files/xbmc-11.0_beta1-libpng-1.5.patch +++ b/media-tv/xbmc/files/xbmc-11.0_beta2-libpng1.5-zenkibou-github.patch @@ -1,30 +1,22 @@ -fix building with newer libpng. patch by Ian Stakenvicius. +From 99d1031476f8ec74d42a54667023746ca4153931 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Damien=20Th=C3=A9bault?= <damien.thebault@gmail.com> +Date: Sat, 14 Jan 2012 23:33:45 +0100 +Subject: [PATCH] Commit cleaned libpng 1.5 support. -https://bugs.gentoo.org/380127 +--- + lib/cximage-6.0/CxImage/ximapng.cpp | 258 ++++++++++++++++++++++++++++++++++- + lib/cximage-6.0/CxImage/ximapng.h | 5 + + 2 files changed, 262 insertions(+), 1 deletions(-) ---- a/xbmc/lib/cximage-6.0/CxImage/ximapng.h -+++ b/xbmc/lib/cximage-6.0/CxImage/ximapng.h -@@ -69,8 +69,13 @@ - - static void PNGAPI user_error_fn(png_structp png_ptr,png_const_charp error_msg) - { -+#if PNG_LIBPNG_VER > 10399 -+ strncpy((char*)png_get_error_ptr(png_ptr),error_msg,255); -+ longjmp(png_jmpbuf(png_ptr), 1); -+#else - strncpy((char*)png_ptr->error_ptr,error_msg,255); - longjmp(png_ptr->jmpbuf, 1); -+#endif - } - }; - ---- a/xbmc/lib/cximage-6.0/CxImage/ximapng.cpp -+++ b/xbmc/lib/cximage-6.0/CxImage/ximapng.cpp +diff --git a/lib/cximage-6.0/CxImage/ximapng.cpp b/lib/cximage-6.0/CxImage/ximapng.cpp +index f718269..3e0cf73 100644 +--- a/lib/cximage-6.0/CxImage/ximapng.cpp ++++ b/lib/cximage-6.0/CxImage/ximapng.cpp @@ -15,7 +15,11 @@ void CxImagePNG::ima_png_error(png_struct *png_ptr, char *message) { strcpy(info.szLastError,message); -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + longjmp(png_jmpbuf(png_ptr), 1); +#else longjmp(png_ptr->jmpbuf, 1); @@ -32,11 +24,11 @@ https://bugs.gentoo.org/380127 } //////////////////////////////////////////////////////////////////////////////// #if CXIMAGE_SUPPORT_DECODE -@@ -62,7 +66,11 @@ +@@ -62,7 +66,11 @@ bool CxImagePNG::Decode(CxFile *hFile) /* Set error handling if you are using the setjmp/longjmp method (this is * the normal method of doing things with libpng). REQUIRED unless you * set up your own error handlers in the png_create_read_struct() earlier. */ -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + if (setjmp(png_jmpbuf(png_ptr))) { +#else if (setjmp(png_ptr->jmpbuf)) { @@ -44,50 +36,46 @@ https://bugs.gentoo.org/380127 /* Free all of the memory associated with the png_ptr and info_ptr */ delete [] row_pointers; png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); -@@ -70,16 +78,35 @@ +@@ -76,16 +84,34 @@ bool CxImagePNG::Decode(CxFile *hFile) /* read the file information */ png_read_info(png_ptr, info_ptr); ++#if PNG_LIBPNG_VER > 10499 + png_uint_32 _width,_height; + int _bit_depth,_color_type,_interlace_type,_compression_type,_filter_type; -+#if PNG_LIBPNG_VER > 10399 + png_get_IHDR(png_ptr,info_ptr,&_width,&_height,&_bit_depth,&_color_type, + &_interlace_type,&_compression_type,&_filter_type); -+#else -+ _width=info_ptr->width; -+ _height=info_ptr->height; -+ _bit_depth=info_ptr->bit_depth; -+ _color_type=info_ptr->color_type; -+ _interlace_type=info_ptr->interlace_type; -+ _compression_type=info_ptr->compression_type; -+ _filter_type=info_ptr->filter_type; -+#endif + - if (info.nEscape == -1){ -- head.biWidth = info_ptr->width; -- head.biHeight= info_ptr->height; ++ if (info.nEscape == -1){ + head.biWidth = _width; + head.biHeight= _height; - info.dwType = CXIMAGE_FORMAT_PNG; -+#if PNG_LIBPNG_VER > 10399 ++ info.dwType = CXIMAGE_FORMAT_PNG; + longjmp(png_jmpbuf(png_ptr), 1); ++ } +#else + if (info.nEscape == -1){ + head.biWidth = info_ptr->width; + head.biHeight= info_ptr->height; + info.dwType = CXIMAGE_FORMAT_PNG; longjmp(png_ptr->jmpbuf, 1); -+#endif } ++#endif /* calculate new number of channels */ int channels=0; -- switch(info_ptr->color_type){ ++#if PNG_LIBPNG_VER > 10499 + switch(_color_type){ ++#else + switch(info_ptr->color_type){ ++#endif case PNG_COLOR_TYPE_GRAY: case PNG_COLOR_TYPE_PALETTE: channels = 1; -@@ -101,71 +128,108 @@ +@@ -101,20 +127,49 @@ bool CxImagePNG::Decode(CxFile *hFile) break; default: strcpy(info.szLastError,"unknown PNG color type"); -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + longjmp(png_jmpbuf(png_ptr), 1); +#else longjmp(png_ptr->jmpbuf, 1); @@ -95,7 +83,7 @@ https://bugs.gentoo.org/380127 } //find the right pixel depth used for cximage -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + int pixel_depth = _bit_depth * png_get_channels(png_ptr,info_ptr); +#else int pixel_depth = info_ptr->pixel_depth; @@ -104,155 +92,171 @@ https://bugs.gentoo.org/380127 if (channels == 2) pixel_depth=8; if (channels >= 3) pixel_depth=24; -- if (!Create(info_ptr->width, info_ptr->height, pixel_depth, CXIMAGE_FORMAT_PNG)){ ++#if PNG_LIBPNG_VER > 10499 + if (!Create(_width, _height, pixel_depth, CXIMAGE_FORMAT_PNG)){ -+#if PNG_LIBPNG_VER > 10399 + longjmp(png_jmpbuf(png_ptr), 1); +#else + if (!Create(info_ptr->width, info_ptr->height, pixel_depth, CXIMAGE_FORMAT_PNG)){ longjmp(png_ptr->jmpbuf, 1); +#endif } /* get metrics */ -- switch (info_ptr->phys_unit_type) ++#if PNG_LIBPNG_VER > 10499 + png_uint_32 _x_pixels_per_unit,_y_pixels_per_unit; + int _phys_unit_type; -+#if PNG_LIBPNG_VER > 10399 + png_get_pHYs(png_ptr,info_ptr,&_x_pixels_per_unit,&_y_pixels_per_unit,&_phys_unit_type); -+#else -+ _x_pixels_per_unit=info_ptr->x_pixels_per_unit; -+ _y_pixels_per_unit=info_ptr->y_pixels_per_unit; -+ _phys_unit_type=info_ptr->phys_unit_type; -+#endif + switch (_phys_unit_type) - { - case PNG_RESOLUTION_UNKNOWN: -- SetXDPI(info_ptr->x_pixels_per_unit); -- SetYDPI(info_ptr->y_pixels_per_unit); ++ { ++ case PNG_RESOLUTION_UNKNOWN: + SetXDPI(_x_pixels_per_unit); + SetYDPI(_y_pixels_per_unit); - break; - case PNG_RESOLUTION_METER: -- SetXDPI((long)floor(info_ptr->x_pixels_per_unit * 254.0 / 10000.0 + 0.5)); -- SetYDPI((long)floor(info_ptr->y_pixels_per_unit * 254.0 / 10000.0 + 0.5)); ++ break; ++ case PNG_RESOLUTION_METER: + SetXDPI((long)floor(_x_pixels_per_unit * 254.0 / 10000.0 + 0.5)); + SetYDPI((long)floor(_y_pixels_per_unit * 254.0 / 10000.0 + 0.5)); ++ break; ++ } ++#else + switch (info_ptr->phys_unit_type) + { + case PNG_RESOLUTION_UNKNOWN: +@@ -126,46 +181,94 @@ bool CxImagePNG::Decode(CxFile *hFile) + SetYDPI((long)floor(info_ptr->y_pixels_per_unit * 254.0 / 10000.0 + 0.5)); break; } ++#endif -- if (info_ptr->num_palette>0){ -- SetPalette((rgb_color*)info_ptr->palette,info_ptr->num_palette); -- SetClrImportant(info_ptr->num_palette); -- } else if (info_ptr->bit_depth ==2) { //<DP> needed for 2 bpp grayscale PNGs ++#if PNG_LIBPNG_VER > 10499 + int _num_palette; + png_colorp _palette; -+#if PNG_LIBPNG_VER > 10399 -+ png_get_PLTE(png_ptr,info_ptr,&_palette,&_num_palette); -+#else -+ _num_palette=info_ptr->num_palette; -+ _palette=info_ptr->palette; -+#endif -+ if (_num_palette>0){ ++ png_uint_32 _palette_ret; ++ _palette_ret = png_get_PLTE(png_ptr,info_ptr,&_palette,&_num_palette); ++ if (_palette_ret && _num_palette>0){ + SetPalette((rgb_color*)_palette,_num_palette); + SetClrImportant(_num_palette); + } else if (_bit_depth ==2) { //<DP> needed for 2 bpp grayscale PNGs ++#else + if (info_ptr->num_palette>0){ + SetPalette((rgb_color*)info_ptr->palette,info_ptr->num_palette); + SetClrImportant(info_ptr->num_palette); + } else if (info_ptr->bit_depth ==2) { //<DP> needed for 2 bpp grayscale PNGs ++#endif SetPaletteColor(0,0,0,0); SetPaletteColor(1,85,85,85); SetPaletteColor(2,170,170,170); SetPaletteColor(3,255,255,255); } else SetGrayPalette(); //<DP> needed for grayscale PNGs -- int nshift = max(0,(info_ptr->bit_depth>>3)-1)<<3; ++#if PNG_LIBPNG_VER > 10499 + int nshift = max(0,(_bit_depth>>3)-1)<<3; ++#else + int nshift = max(0,(info_ptr->bit_depth>>3)-1)<<3; ++#endif -- if (info_ptr->num_trans!=0){ //palette transparency -- if (info_ptr->num_trans==1){ -- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE){ ++#if PNG_LIBPNG_VER > 10499 + png_bytep _trans_alpha; + int _num_trans; + png_color_16p _trans_color; -+#if PNG_LIBPNG_VER > 10399 -+ png_get_tRNS(png_ptr,info_ptr,&_trans_alpha,&_num_trans,&_trans_color); -+#else -+ _num_trans=info_ptr->num_trans; -+#endif -+ if (_num_trans!=0){ //palette transparency ++ png_uint_32 _trans_ret; ++ _trans_ret = png_get_tRNS(png_ptr,info_ptr,&_trans_alpha,&_num_trans,&_trans_color); ++ if (_trans_ret && _num_trans!=0){ //palette transparency + if (_num_trans==1){ + if (_color_type == PNG_COLOR_TYPE_PALETTE){ - #if PNG_LIBPNG_VER > 10399 -- info.nBkgndIndex = info_ptr->trans_color.index; ++#else + if (info_ptr->num_trans!=0){ //palette transparency + if (info_ptr->num_trans==1){ + if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE){ ++#endif ++#if PNG_LIBPNG_VER > 10499 + info.nBkgndIndex = _trans_color->index; ++#else + #if PNG_LIBPNG_VER > 10399 + info.nBkgndIndex = info_ptr->trans_color.index; #else info.nBkgndIndex = info_ptr->trans_values.index; #endif ++#endif } else{ - #if PNG_LIBPNG_VER > 10399 -- info.nBkgndIndex = info_ptr->trans_color.gray>>nshift; ++#if PNG_LIBPNG_VER > 10499 + info.nBkgndIndex = _trans_color->gray>>nshift; ++#else + #if PNG_LIBPNG_VER > 10399 + info.nBkgndIndex = info_ptr->trans_color.gray>>nshift; #else info.nBkgndIndex = info_ptr->trans_values.gray>>nshift; #endif ++#endif } } -- if (info_ptr->num_trans>1){ -+ if (_num_trans>1){ ++#if PNG_LIBPNG_VER > 10499 ++ if (_num_trans>1 && _trans_alpha!=NULL){ ++#else + if (info_ptr->num_trans>1){ ++#endif RGBQUAD* pal=GetPalette(); if (pal){ DWORD ip; -- for (ip=0;ip<min(head.biClrUsed,(unsigned long)info_ptr->num_trans);ip++) ++#if PNG_LIBPNG_VER > 10499 + for (ip=0;ip<min(head.biClrUsed,(unsigned long)_num_trans);ip++) - #if PNG_LIBPNG_VER > 10399 -- pal[ip].rgbReserved=info_ptr->trans_alpha[ip]; + pal[ip].rgbReserved=_trans_alpha[ip]; ++#else + for (ip=0;ip<min(head.biClrUsed,(unsigned long)info_ptr->num_trans);ip++) + #if PNG_LIBPNG_VER > 10399 + pal[ip].rgbReserved=info_ptr->trans_alpha[ip]; #else pal[ip].rgbReserved=info_ptr->trans[ip]; #endif -- for (ip=info_ptr->num_trans;ip<head.biClrUsed;ip++){ ++#endif ++#if PNG_LIBPNG_VER > 10499 + for (ip=_num_trans;ip<head.biClrUsed;ip++){ ++#else + for (ip=info_ptr->num_trans;ip<head.biClrUsed;ip++){ ++#endif pal[ip].rgbReserved=255; } info.bAlphaPaletteEnabled=true; -@@ -174,14 +238,12 @@ - } - - if (channels == 3){ //check RGB binary transparency -- png_bytep trans; -- int num_trans; -- png_color_16 *image_background; -- if (png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, &image_background)){ --#if PNG_LIBPNG_VER > 10399 -- info.nBkgndColor.rgbRed = (BYTE)(info_ptr->trans_color.red>>nshift); -- info.nBkgndColor.rgbGreen = (BYTE)(info_ptr->trans_color.green>>nshift); -- info.nBkgndColor.rgbBlue = (BYTE)(info_ptr->trans_color.blue>>nshift); -+ /* seems unnecessary to call again, but the conditional must be important so... */ -+ if (png_get_tRNS(png_ptr,info_ptr,&_trans_alpha,&_num_trans,&_trans_color)){ -+#if PNG_LIBPNG_VER > 10399 +@@ -178,6 +281,11 @@ bool CxImagePNG::Decode(CxFile *hFile) + int num_trans; + png_color_16 *image_background; + if (png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, &image_background)){ ++#if PNG_LIBPNG_VER > 10499 + info.nBkgndColor.rgbRed = (BYTE)(_trans_color->red>>nshift); + info.nBkgndColor.rgbGreen = (BYTE)(_trans_color->green>>nshift); + info.nBkgndColor.rgbBlue = (BYTE)(_trans_color->blue>>nshift); - #else - info.nBkgndColor.rgbRed = (BYTE)(info_ptr->trans_values.red>>nshift); ++#else + #if PNG_LIBPNG_VER > 10399 + info.nBkgndColor.rgbRed = (BYTE)(info_ptr->trans_color.red>>nshift); + info.nBkgndColor.rgbGreen = (BYTE)(info_ptr->trans_color.green>>nshift); +@@ -187,6 +295,7 @@ bool CxImagePNG::Decode(CxFile *hFile) info.nBkgndColor.rgbGreen = (BYTE)(info_ptr->trans_values.green>>nshift); -@@ -202,15 +264,24 @@ + info.nBkgndColor.rgbBlue = (BYTE)(info_ptr->trans_values.blue>>nshift); + #endif ++#endif + info.nBkgndColor.rgbReserved = 0; + info.nBkgndIndex = 0; + } +@@ -202,15 +311,27 @@ bool CxImagePNG::Decode(CxFile *hFile) } // <vho> - flip the RGB pixels to BGR (or RGBA to BGRA) -- if (info_ptr->color_type & PNG_COLOR_MASK_COLOR){ ++#if PNG_LIBPNG_VER > 10499 + if (_color_type & PNG_COLOR_MASK_COLOR){ ++#else + if (info_ptr->color_type & PNG_COLOR_MASK_COLOR){ ++#endif png_set_bgr(png_ptr); } // <vho> - handle cancel -- if (info.nEscape) longjmp(png_ptr->jmpbuf, 1); -+ if (info.nEscape) -+#if PNG_LIBPNG_VER > 10399 -+ longjmp(png_jmpbuf(png_ptr), 1); ++#if PNG_LIBPNG_VER > 10499 ++ if (info.nEscape) longjmp(png_jmpbuf(png_ptr), 1); +#else -+ longjmp(png_ptr->jmpbuf, 1); + if (info.nEscape) longjmp(png_ptr->jmpbuf, 1); +#endif // row_bytes is the width x number of channels x (bit-depth / 8) -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + row_pointers = new BYTE[png_get_rowbytes(png_ptr,info_ptr) + 8]; +#else row_pointers = new BYTE[info_ptr->rowbytes + 8]; @@ -260,13 +264,16 @@ https://bugs.gentoo.org/380127 // turn on interlace handling int number_passes = png_set_interlace_handling(png_ptr); -@@ -221,8 +292,12 @@ +@@ -221,8 +342,16 @@ bool CxImagePNG::Decode(CxFile *hFile) SetCodecOption(0); } -- int chan_offset = info_ptr->bit_depth >> 3; ++#if PNG_LIBPNG_VER > 10499 + int chan_offset = _bit_depth >> 3; -+#if PNG_LIBPNG_VER > 10399 ++#else + int chan_offset = info_ptr->bit_depth >> 3; ++#endif ++#if PNG_LIBPNG_VER > 10499 + int pixel_offset = (_bit_depth * png_get_channels(png_ptr,info_ptr)) >> 3; +#else int pixel_offset = info_ptr->pixel_depth >> 3; @@ -274,73 +281,81 @@ https://bugs.gentoo.org/380127 for (int pass=0; pass < number_passes; pass++) { iter.Upset(); -@@ -230,7 +305,12 @@ +@@ -230,7 +359,11 @@ bool CxImagePNG::Decode(CxFile *hFile) do { // <vho> - handle cancel -- if (info.nEscape) longjmp(png_ptr->jmpbuf, 1); -+ if (info.nEscape) -+#if PNG_LIBPNG_VER > 10399 -+ longjmp(png_jmpbuf(png_ptr), 1); ++#if PNG_LIBPNG_VER > 10499 ++ if (info.nEscape) longjmp(png_jmpbuf(png_ptr), 1); +#else -+ longjmp(png_ptr->jmpbuf, 1); + if (info.nEscape) longjmp(png_ptr->jmpbuf, 1); +#endif #if CXIMAGE_SUPPORT_ALPHA // <vho> if (AlphaIsValid()) { -@@ -241,7 +321,7 @@ +@@ -241,7 +374,11 @@ bool CxImagePNG::Decode(CxFile *hFile) BYTE* prow= iter.GetRow(ay); //recover data from previous scan -- if (info_ptr->interlace_type && pass>0 && pass!=7){ ++#if PNG_LIBPNG_VER > 10499 + if (_interlace_type && pass>0 && pass!=7){ ++#else + if (info_ptr->interlace_type && pass>0 && pass!=7){ ++#endif for(ax=0;ax<head.biWidth;ax++){ long px = ax * pixel_offset; if (channels == 2){ -@@ -278,10 +358,14 @@ +@@ -278,10 +415,17 @@ bool CxImagePNG::Decode(CxFile *hFile) #endif // CXIMAGE_SUPPORT_ALPHA // vho { //recover data from previous scan -- if (info_ptr->interlace_type && pass>0){ ++#if PNG_LIBPNG_VER > 10499 + if (_interlace_type && pass>0){ -+#if PNG_LIBPNG_VER > 10399 + iter.GetRow(row_pointers, png_get_rowbytes(png_ptr,info_ptr)); ++ //re-expand buffer for images with bit depth > 8 ++ if (_bit_depth > 8){ +#else + if (info_ptr->interlace_type && pass>0){ iter.GetRow(row_pointers, info_ptr->rowbytes); -+#endif //re-expand buffer for images with bit depth > 8 -- if (info_ptr->bit_depth > 8){ -+ if (_bit_depth > 8){ + if (info_ptr->bit_depth > 8){ ++#endif for(long ax=(head.biWidth*channels-1);ax>=0;ax--) row_pointers[ax*chan_offset] = row_pointers[ax]; } -@@ -291,15 +375,19 @@ +@@ -291,15 +435,27 @@ bool CxImagePNG::Decode(CxFile *hFile) png_read_row(png_ptr, row_pointers, NULL); //shrink 16 bit depth images down to 8 bits -- if (info_ptr->bit_depth > 8){ ++#if PNG_LIBPNG_VER > 10499 + if (_bit_depth > 8){ ++#else + if (info_ptr->bit_depth > 8){ ++#endif for(long ax=0;ax<(head.biWidth*channels);ax++) row_pointers[ax] = row_pointers[ax*chan_offset]; } //copy the pixels -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + iter.SetRow(row_pointers, png_get_rowbytes(png_ptr,info_ptr)); +#else iter.SetRow(row_pointers, info_ptr->rowbytes); +#endif //<DP> expand 2 bpp images only in the last pass -- if (info_ptr->bit_depth==2 && pass==(number_passes-1)) ++#if PNG_LIBPNG_VER > 10499 + if (_bit_depth==2 && pass==(number_passes-1)) ++#else + if (info_ptr->bit_depth==2 && pass==(number_passes-1)) ++#endif expand2to4bpp(iter.GetRow()); //go on -@@ -361,9 +449,13 @@ +@@ -361,9 +517,13 @@ bool CxImagePNG::Encode(CxFile *hFile) /* Set error handling. REQUIRED if you aren't supplying your own * error hadnling functions in the png_create_write_struct() call. */ -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + if (setjmp(png_jmpbuf(png_ptr))){ +#else if (setjmp(png_ptr->jmpbuf)){ @@ -350,7 +365,7 @@ https://bugs.gentoo.org/380127 png_destroy_write_struct(&png_ptr, (png_infopp)&info_ptr); cx_throw("Error saving PNG file"); } -@@ -372,9 +464,23 @@ +@@ -372,9 +532,23 @@ bool CxImagePNG::Encode(CxFile *hFile) //png_init_io(png_ptr, hFile); // use custom I/O functions @@ -358,7 +373,7 @@ https://bugs.gentoo.org/380127 + png_set_write_fn(png_ptr,hFile,/*(png_rw_ptr)*/user_write_data,/*(png_flush_ptr)*/user_flush_data); /* set the file information here */ -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + /* use variables to hold the values so it isnt necessary to png_get them later */ + png_uint_32 _width,_height; + int _bit_depth,_color_type,_interlace_type,_compression_type,_filter_type; @@ -375,7 +390,7 @@ https://bugs.gentoo.org/380127 info_ptr->width = GetWidth(); info_ptr->height = GetHeight(); info_ptr->pixel_depth = (BYTE)GetBpp(); -@@ -382,13 +488,22 @@ +@@ -382,13 +556,22 @@ bool CxImagePNG::Encode(CxFile *hFile) info_ptr->bit_depth = (BYTE)(GetBpp()/info_ptr->channels); info_ptr->compression_type = info_ptr->filter_type = 0; info_ptr->valid = 0; @@ -383,14 +398,14 @@ https://bugs.gentoo.org/380127 switch(GetCodecOption(CXIMAGE_FORMAT_PNG)){ case 1: -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + _interlace_type = PNG_INTERLACE_ADAM7; +#else info_ptr->interlace_type = PNG_INTERLACE_ADAM7; +#endif break; default: -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + _interlace_type = PNG_INTERLACE_NONE; +#else info_ptr->interlace_type = PNG_INTERLACE_NONE; @@ -398,24 +413,24 @@ https://bugs.gentoo.org/380127 } /* set compression level */ -@@ -398,22 +513,47 @@ +@@ -398,19 +581,38 @@ bool CxImagePNG::Encode(CxFile *hFile) if (GetNumColors()){ if (bGrayScale){ -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + _color_type = PNG_COLOR_TYPE_GRAY; +#else info_ptr->color_type = PNG_COLOR_TYPE_GRAY; +#endif } else { -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + _color_type = PNG_COLOR_TYPE_PALETTE; +#else info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; +#endif } } else { -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + _color_type = PNG_COLOR_TYPE_RGB; +#else info_ptr->color_type = PNG_COLOR_TYPE_RGB; @@ -423,7 +438,7 @@ https://bugs.gentoo.org/380127 } #if CXIMAGE_SUPPORT_ALPHA if (AlphaIsValid()){ -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + _color_type |= PNG_COLOR_MASK_ALPHA; + _channels++; + _bit_depth = 8; @@ -437,20 +452,14 @@ https://bugs.gentoo.org/380127 } #endif -+#if PNG_LIBPNG_VER > 10399 -+ /* set the header here, since we're done modifying these values */ -+ png_set_IHDR(png_ptr,info_ptr,_width,_height,_bit_depth,_color_type,_interlace_type, -+ _compression_type,_filter_type); -+#endif -+ - /* set background */ - png_color_16 image_background={ 0, 255, 255, 255, 0 }; - RGBQUAD tc = GetTransColor(); -@@ -427,22 +567,24 @@ +@@ -427,14 +629,30 @@ bool CxImagePNG::Encode(CxFile *hFile) /* set metrics */ png_set_pHYs(png_ptr, info_ptr, head.biXPelsPerMeter, head.biYPelsPerMeter, PNG_RESOLUTION_METER); -+#if PNG_LIBPNG_VER <= 10399 ++#if PNG_LIBPNG_VER > 10499 ++ png_set_IHDR(png_ptr,info_ptr,_width,_height,_bit_depth,_color_type,_interlace_type, ++ _compression_type,_filter_type); ++#else png_set_IHDR(png_ptr, info_ptr, info_ptr->width, info_ptr->height, info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); @@ -458,43 +467,40 @@ https://bugs.gentoo.org/380127 //<DP> simple transparency if (info.nBkgndIndex >= 0){ -- info_ptr->num_trans = 1; -- info_ptr->valid |= PNG_INFO_tRNS; - #if PNG_LIBPNG_VER > 10399 -- info_ptr->trans_alpha = trans; -- info_ptr->trans_color.index = (BYTE)info.nBkgndIndex; -- info_ptr->trans_color.red = tc.rgbRed; -- info_ptr->trans_color.green = tc.rgbGreen; -- info_ptr->trans_color.blue = tc.rgbBlue; -- info_ptr->trans_color.gray = info_ptr->trans_color.index; ++#if PNG_LIBPNG_VER <= 10499 + info_ptr->num_trans = 1; + info_ptr->valid |= PNG_INFO_tRNS; ++#endif ++#if PNG_LIBPNG_VER > 10499 + png_color_16 _trans_color; + _trans_color.index = (BYTE)info.nBkgndIndex; + _trans_color.red = tc.rgbRed; + _trans_color.green = tc.rgbGreen; + _trans_color.blue = tc.rgbBlue; + _trans_color.gray = _trans_color.index; - #else -+ info_ptr->num_trans = 1; -+ info_ptr->valid |= PNG_INFO_tRNS; - info_ptr->trans = trans; - info_ptr->trans_values.index = (BYTE)info.nBkgndIndex; - info_ptr->trans_values.red = tc.rgbRed; -@@ -454,34 +596,53 @@ - // the transparency indexes start from 0 for non grayscale palette - if (!bGrayScale && head.biClrUsed && info.nBkgndIndex) - SwapIndex(0,(BYTE)info.nBkgndIndex); -+ -+#if PNG_LIBPNG_VER > 10399 + png_set_tRNS(png_ptr,info_ptr,(png_bytep)trans,1,&_trans_color); ++#else + #if PNG_LIBPNG_VER > 10399 + info_ptr->trans_alpha = trans; + info_ptr->trans_color.index = (BYTE)info.nBkgndIndex; +@@ -450,6 +668,7 @@ bool CxImagePNG::Encode(CxFile *hFile) + info_ptr->trans_values.blue = tc.rgbBlue; + info_ptr->trans_values.gray = info_ptr->trans_values.index; + #endif +#endif + + // the transparency indexes start from 0 for non grayscale palette + if (!bGrayScale && head.biClrUsed && info.nBkgndIndex) +@@ -457,10 +676,16 @@ bool CxImagePNG::Encode(CxFile *hFile) } /* set the palette if there is one */ -+#if PNG_LIBPNG_VER > 10399 -+ png_colorp _palette; -+#endif ++#if PNG_LIBPNG_VER > 10499 ++ png_colorp _palette = NULL; ++ if (GetPalette()){ ++ /* png_set_PLTE() will be called once the palette is ready */ ++#else if (GetPalette()){ -+#if PNG_LIBPNG_VER <= 10399 if (!bGrayScale){ info_ptr->valid |= PNG_INFO_PLTE; } @@ -502,51 +508,46 @@ https://bugs.gentoo.org/380127 int nc = GetClrImportant(); if (nc==0) nc = GetNumColors(); - -+ // copy the palette colors -+#if PNG_LIBPNG_VER > 10399 -+ _palette = new png_color[nc]; -+#else -+ info_ptr->palette = new png_color[nc]; -+ info_ptr->num_palette = (png_uint_16) nc; -+#endif -+ for (int i=0; i<nc; i++) -+#if PNG_LIBPNG_VER > 10399 -+ GetPaletteColor(i, &_palette[i].red, &_palette[i].green, &_palette[i].blue); -+ -+ png_set_PLTE(png_ptr,info_ptr,_palette,nc); -+#else -+ GetPaletteColor(i, &info_ptr->palette[i].red, &info_ptr->palette[i].green, &info_ptr->palette[i].blue); -+#endif -+ +@@ -468,20 +693,34 @@ bool CxImagePNG::Encode(CxFile *hFile) if (info.bAlphaPaletteEnabled){ for(WORD ip=0; ip<nc;ip++) trans[ip]=GetPaletteColor((BYTE)ip).rgbReserved; -- info_ptr->num_trans = (WORD)nc; -- info_ptr->valid |= PNG_INFO_tRNS; - #if PNG_LIBPNG_VER > 10399 -- info_ptr->trans_alpha = trans; ++#if PNG_LIBPNG_VER <= 10499 + info_ptr->num_trans = (WORD)nc; + info_ptr->valid |= PNG_INFO_tRNS; ++#endif ++#if PNG_LIBPNG_VER > 10499 + png_set_tRNS(png_ptr,info_ptr,(png_bytep)trans,nc,NULL); ++#else + #if PNG_LIBPNG_VER > 10399 + info_ptr->trans_alpha = trans; #else -+ info_ptr->num_trans = (WORD)nc; -+ info_ptr->valid |= PNG_INFO_tRNS; info_ptr->trans = trans; #endif ++#endif } -- -- // copy the palette colors -- info_ptr->palette = new png_color[nc]; -- info_ptr->num_palette = (png_uint_16) nc; -- for (int i=0; i<nc; i++) -- GetPaletteColor(i, &info_ptr->palette[i].red, &info_ptr->palette[i].green, &info_ptr->palette[i].blue); + + // copy the palette colors ++#if PNG_LIBPNG_VER > 10499 ++ _palette = new png_color[nc]; ++ for (int i=0; i<nc; i++) ++ GetPaletteColor(i, &_palette[i].red, &_palette[i].green, &_palette[i].blue); ++ ++ png_set_PLTE(png_ptr,info_ptr,_palette,nc); ++#else + info_ptr->palette = new png_color[nc]; + info_ptr->num_palette = (png_uint_16) nc; + for (int i=0; i<nc; i++) + GetPaletteColor(i, &info_ptr->palette[i].red, &info_ptr->palette[i].green, &info_ptr->palette[i].blue); ++#endif } #if CXIMAGE_SUPPORT_ALPHA // <vho> -@@ -495,8 +656,12 @@ +@@ -495,8 +734,12 @@ bool CxImagePNG::Encode(CxFile *hFile) } } } #endif // CXIMAGE_SUPPORT_ALPHA // <vho> -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + int row_size = max(info.dwEffWidth, (_width * _channels * _bit_depth / 8)); +#else int row_size = max(info.dwEffWidth, info_ptr->width*info_ptr->channels*(info_ptr->bit_depth/8)); @@ -555,11 +556,11 @@ https://bugs.gentoo.org/380127 BYTE *row_pointers = new BYTE[row_size]; /* write the file information */ -@@ -514,7 +679,11 @@ +@@ -514,7 +757,11 @@ bool CxImagePNG::Encode(CxFile *hFile) if (AlphaIsValid()){ for (long ax=head.biWidth-1; ax>=0;ax--){ c = BlindGetPixelColor(ax,ay); -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + int px = ax * _channels; +#else int px = ax * info_ptr->channels; @@ -567,11 +568,11 @@ https://bugs.gentoo.org/380127 if (!bGrayScale){ row_pointers[px++]=c.rgbRed; row_pointers[px++]=c.rgbGreen; -@@ -529,7 +698,11 @@ +@@ -529,7 +776,11 @@ bool CxImagePNG::Encode(CxFile *hFile) #endif //CXIMAGE_SUPPORT_ALPHA // <vho> { iter.GetRow(row_pointers, row_size); -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + if (_color_type == PNG_COLOR_TYPE_RGB) //HACK BY OP +#else if (info_ptr->color_type == PNG_COLOR_TYPE_RGB) //HACK BY OP @@ -579,11 +580,11 @@ https://bugs.gentoo.org/380127 RGBtoBGR(row_pointers, row_size); png_write_row(png_ptr, row_pointers); } -@@ -546,9 +719,14 @@ +@@ -546,9 +797,14 @@ bool CxImagePNG::Encode(CxFile *hFile) png_write_end(png_ptr, info_ptr); /* if you malloced the palette, free it here */ -+#if PNG_LIBPNG_VER > 10399 ++#if PNG_LIBPNG_VER > 10499 + if (_palette){ + delete [] (_palette); +#else @@ -594,3 +595,24 @@ https://bugs.gentoo.org/380127 } /* clean up after the write, and free any memory allocated */ +diff --git a/lib/cximage-6.0/CxImage/ximapng.h b/lib/cximage-6.0/CxImage/ximapng.h +index db41935..68d8ddb 100644 +--- a/lib/cximage-6.0/CxImage/ximapng.h ++++ b/lib/cximage-6.0/CxImage/ximapng.h +@@ -69,8 +69,13 @@ class CxImagePNG: public CxImage + + static void PNGAPI user_error_fn(png_structp png_ptr,png_const_charp error_msg) + { ++#if PNG_LIBPNG_VER > 10499 ++ strncpy((char*)png_get_error_ptr(png_ptr),error_msg,255); ++ longjmp(png_jmpbuf(png_ptr), 1); ++#else + strncpy((char*)png_ptr->error_ptr,error_msg,255); + longjmp(png_ptr->jmpbuf, 1); ++#endif + } + }; + +-- +1.7.5.4 + diff --git a/media-tv/xbmc/xbmc-11.0_beta2.ebuild b/media-tv/xbmc/xbmc-11.0_beta2.ebuild index 5605b34..68609f3 100644 --- a/media-tv/xbmc/xbmc-11.0_beta2.ebuild +++ b/media-tv/xbmc/xbmc-11.0_beta2.ebuild @@ -156,13 +156,8 @@ src_prepare() { sed -i \ -e '/dbus_connection_send_with_reply_and_block/s:-1:3000:' \ xbmc/linux/*.cpp || die - - epatch ${FILESDIR}/xbmc-11.0_beta1-libpng-1.5-headers.patch || die - epatch ${FILESDIR}/xbmc-11.0_beta1-libpng-1.5.patch || die - epatch ${FILESDIR}/xbmc-11.0_beta1-libpng-1.5-fix-plt-trn-get.patch || die - - + epatch ${FILESDIR}/xbmc-11.0_beta2-libpng1.5-zenkibou-github.patch || die epatch_user #293109 |