JFJochReceiver: if no images sent, return compressed ratio of 0
This commit is contained in:
@@ -504,13 +504,14 @@ void JFJochReceiver::GetStatistics(JFJochProtoBuf::ReceiverOutput &ret) const {
|
||||
ret.set_compressed_size(compressed_size);
|
||||
ret.set_max_image_number_sent(max_image_number_sent);
|
||||
|
||||
if (experiment.GetImageNum() > 0) {
|
||||
if ((experiment.GetImageNum() > 0) && (compressed_size > 0)) {
|
||||
ret.set_compressed_ratio( static_cast<double> (images_sent
|
||||
* experiment.GetPixelDepth()
|
||||
* experiment.GetModulesNum()
|
||||
* RAW_MODULE_SIZE)
|
||||
/ static_cast<double> (compressed_size));
|
||||
}
|
||||
} else
|
||||
ret.set_compressed_ratio(0);
|
||||
|
||||
if (!max_delay.empty())
|
||||
ret.set_max_receive_delay(*std::max_element(max_delay.begin(), max_delay.end()));
|
||||
|
||||
Reference in New Issue
Block a user