From: Peter H. <pe...@ho...> - 2005-06-26 18:19:34
|
> I do not understand this part of your patch. The code > > cinfo.err = jpeg_std_error(&jerr.pub); > jerr.pub.error_exit = my_error_exit; > hretries = MAX_HEADER_RETRIES; > > if (setjmp(jerr.setjmp_buffer)) { > const char msg[] = "netcam: jpeglib read header failed"; > syslog(LOG_ERR, "[%d] %s", cnt->threadnr, msg); > printf("[%d] %s\n", cnt->threadnr, msg); > jpeg_destroy_decompress(&cinfo); > if (!netcam->caps.streaming || !(--hretries)) ret = -1; > } > > How does hretries ever become anything else than MAX_HEADER_RETRIES? > > Kenneth First hretries is initialized to MAX_HEADER_RETRIES. Than a setjmp is set and if the jpeglib founds an error a jump is made to after the setjmp call (via my_error_exit). There is a "if" where hretries is pre-decremented and on "0" ret is set to -1 cu Peter |