void jpeg_decoder_thread()
{
+ size_t num_decoded = 0, num_dropped = 0;
+
pthread_setname_np(pthread_self(), "JPEGDecoder");
for ( ;; ) {
JPEGID id;
}
}
if (num_pending > 3) {
+ ++num_dropped;
continue;
}
if (cache.size() > CACHE_SIZE) {
prune_cache();
}
+ ++num_decoded;
+ if (num_decoded % 1000 == 0) {
+ fprintf(stderr, "Decoded %zu images, dropped %zu (%.2f%% dropped)\n",
+ num_decoded, num_dropped, (100.0 * num_dropped) / (num_decoded + num_dropped));
+ }
}
dest->setPixmap(pixmap);