From: Carl Hetherington Date: Sun, 31 Jan 2016 01:11:22 +0000 (+0000) Subject: Fix set_position() causing a re-sort. X-Git-Tag: v2.6.17~2 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=030c74f085718ea276c6e55a7a7c7de267a9ebf3;p=dcpomatic.git Fix set_position() causing a re-sort. --- diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index e3d0c8ebb..b5faec567 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -426,9 +426,10 @@ Playlist::move_earlier (shared_ptr c) return; } + shared_ptr previous_c = *previous; - DCPTime const p = (*previous)->position (); - (*previous)->set_position (p + c->length_after_trim ()); + DCPTime const p = previous_c->position (); + previous_c->set_position (p + c->length_after_trim ()); c->set_position (p); } @@ -449,8 +450,10 @@ Playlist::move_later (shared_ptr c) return; } - (*next)->set_position (c->position ()); - c->set_position (c->position() + (*next)->length_after_trim ()); + shared_ptr next_c = *next; + + next_c->set_position (c->position ()); + c->set_position (c->position() + next_c->length_after_trim ()); } int64_t