summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-09 09:38:50 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-09 09:38:50 -0700
commita26719c5419754b24a16b7c8163d236eae765a6d (patch)
tree6c735fa8d100686cd06c679584c3632b41347b00 /dive.c
parentb0983d9d13d2d967d52a0fbbc1052f7f6eca840a (diff)
downloadsubsurface-a26719c5419754b24a16b7c8163d236eae765a6d.tar.gz
Picture handling: switch to stronger typed offset
Also change the on file XML to be even easier to read by making it a duration as well (which gets us '32:34 min' instead of un-typed seconds). This is backwards compatible, it will happily read what was written with the previous commit). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dive.c b/dive.c
index 1c594db2e..68b811217 100644
--- a/dive.c
+++ b/dive.c
@@ -2290,7 +2290,7 @@ void dive_create_picture(struct dive *d, char *filename, int shift_time)
p->filename = filename;
picture_load_exif_data(p, &timestamp);
if (timestamp)
- p->offset = timestamp - d->when + shift_time;
+ p->offset.seconds = timestamp - d->when + shift_time;
dive_add_picture(d, p);
dive_set_geodata_from_picture(d, p);
}
@@ -2299,7 +2299,7 @@ void dive_add_picture(struct dive *d, struct picture *newpic)
{
struct picture **pic_ptr = &d->picture_list;
/* let's keep the list sorted by time */
- while( *pic_ptr && (*pic_ptr)->offset < newpic->offset )
+ while( *pic_ptr && (*pic_ptr)->offset.seconds < newpic->offset.seconds )
pic_ptr = &(*pic_ptr)->next;
newpic->next = *pic_ptr;
*pic_ptr = newpic;