Commit c27314d60 ("core: replace add_sample() by append_sample()") broke
the dive computer interleaving when merging two dives: the sample
merging (done by "merge_samples()") no longer took the offset between
the two merged dives into account, and instead just blindly copied the
samples from the second dive computer with no time offset.
The end result was a completely broken profile.
This adds back the sample offset. It also takes the offset not from the
difference in time of the two dives, but the difference in time of the
dive computers. That way we're not mixing up different times from
different sources that aren't necessarily in sync (the time *difference*
is hopefully the same, but still..).
The dive merging still messes up the dive location. That's some other bug.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>