Don't overwrite air temperature

If we already have an air temperature set, don't overwrite it with
potentially less accurate infromation from the first sample.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-11-25 12:08:28 -08:00
parent 23cb9b49c2
commit 0a59fd74e2

View file

@ -695,7 +695,7 @@ static int dive_cb(const unsigned char *data, unsigned int size,
dc_parser_destroy(parser);
/* Various libdivecomputer interface fixups */
if (first_temp_is_air && dive->dc.samples) {
if (dive->dc.airtemp.mkelvin == 0 && first_temp_is_air && dive->dc.samples) {
dive->dc.airtemp = dive->dc.sample[0].temperature;
dive->dc.sample[0].temperature.mkelvin = 0;
}