Disable jpg logging to make it thread safe

This commit is contained in:
Benau 2018-10-31 13:26:34 +08:00
parent 0b2a691b24
commit c25c12e7a5
2 changed files with 4 additions and 12 deletions

View File

@ -16,9 +16,6 @@ namespace irr
namespace video namespace video
{ {
// Static members
io::path CImageLoaderJPG::Filename;
//! constructor //! constructor
CImageLoaderJPG::CImageLoaderJPG() CImageLoaderJPG::CImageLoaderJPG()
{ {
@ -108,10 +105,10 @@ void CImageLoaderJPG::error_exit (j_common_ptr cinfo)
void CImageLoaderJPG::output_message(j_common_ptr cinfo) void CImageLoaderJPG::output_message(j_common_ptr cinfo)
{ {
// display the error message. // display the error message.
c8 temp1[JMSG_LENGTH_MAX]; //c8 temp1[JMSG_LENGTH_MAX];
(*cinfo->err->format_message)(cinfo, temp1); //(*cinfo->err->format_message)(cinfo, temp1);
core::stringc errMsg("JPEG FATAL ERROR in "); //core::stringc errMsg("JPEG FATAL ERROR in ");
errMsg += core::stringc(Filename); //errMsg += core::stringc(Filename);
//os::Printer::log(errMsg.c_str(),temp1, ELL_ERROR); //os::Printer::log(errMsg.c_str(),temp1, ELL_ERROR);
} }
#endif // _IRR_COMPILE_WITH_LIBJPEG_ #endif // _IRR_COMPILE_WITH_LIBJPEG_
@ -145,8 +142,6 @@ IImage* CImageLoaderJPG::loadImage(io::IReadFile* file, bool skip_checking) cons
if (!file) if (!file)
return 0; return 0;
Filename = file->getFileName();
u8 **rowPtr=0; u8 **rowPtr=0;
u8* input = new u8[file->getSize()]; u8* input = new u8[file->getSize()];
file->read(input, file->getSize()); file->read(input, file->getSize());

View File

@ -100,9 +100,6 @@ private:
data has been read. Often a no-op. */ data has been read. Often a no-op. */
static void term_source (j_decompress_ptr cinfo); static void term_source (j_decompress_ptr cinfo);
// Copy filename to have it around for error-messages
static io::path Filename;
#endif // _IRR_COMPILE_WITH_LIBJPEG_ #endif // _IRR_COMPILE_WITH_LIBJPEG_
}; };