diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-08-17 11:47:05 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-08-17 11:47:05 +0300 |
commit | 1e605357b5ed3d206e36e88dc3ebc7961b5552ef (patch) | |
tree | a30eb0e733cd959211b2433eaf5e8af857d5c6ac /source/blender | |
parent | 069bc4086c8afbf03d5fd5e8d63fcd6c46b2864e (diff) |
2D stabilizer: Remove check for markers count in the track
This would be a real disaster if track has no markers, which we should
not masquerade and detect such weird cases as soon as possible.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/tracking_stabilize.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/tracking_stabilize.c b/source/blender/blenkernel/intern/tracking_stabilize.c index 1d571099723..c352625789f 100644 --- a/source/blender/blenkernel/intern/tracking_stabilize.c +++ b/source/blender/blenkernel/intern/tracking_stabilize.c @@ -414,21 +414,18 @@ static MovieTrackingMarker *get_closest_marker(StabContext *ctx, MovieTrackingTrack *track, int ref_frame) { - if (track->markersnr > 0) { - int next_lower = MINAFRAME; - int next_higher = MAXFRAME; - int i = search_closest_marker_index(track, ref_frame); - retrieve_next_higher_usable_frame(ctx, track, i, ref_frame, &next_higher); - retrieve_next_lower_usable_frame(ctx, track, i, ref_frame, &next_lower); - - if ((next_higher - ref_frame) < (ref_frame - next_lower)) { - return BKE_tracking_marker_get_exact(track, next_higher); - } - else { - return BKE_tracking_marker_get_exact(track, next_lower); - } + int next_lower = MINAFRAME; + int next_higher = MAXFRAME; + int i = search_closest_marker_index(track, ref_frame); + retrieve_next_higher_usable_frame(ctx, track, i, ref_frame, &next_higher); + retrieve_next_lower_usable_frame(ctx, track, i, ref_frame, &next_lower); + + if ((next_higher - ref_frame) < (ref_frame - next_lower)) { + return BKE_tracking_marker_get_exact(track, next_higher); + } + else { + return BKE_tracking_marker_get_exact(track, next_lower); } - return NULL; } |