diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2014-12-11 23:36:29 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2014-12-11 23:36:29 (GMT) |
commit | d914e8d2d2196e96e478949854df85f273d92a84 (patch) | |
tree | a876f41ae0e00813c9d73a95e7d4560eb2f87d42 | |
parent | a05d49a9f0ba5d134129007c726a4e4d19273eda (diff) |
Fixed bug reading last frame and time of last frame.
Change-Id: I983333cc30b2d3add0b5a35e29b5d67736927cd4
-rw-r--r-- | src/lib/tng_io.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index 6b467a8..237db3e 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -15649,7 +15649,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_particle_data_next_frame_read } else { - if(data->n_frames == 1) + if(data->n_frames == 1 && frame_set->n_frames == 1) { i = data->last_retrieved_frame + 1; } @@ -15813,7 +15813,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_non_particle_data_next_frame_read } else { - if(data->n_frames == 1) + if(data->n_frames == 1 && frame_set->n_frames == 1) { i = data->last_retrieved_frame + 1; } @@ -17507,6 +17507,10 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat { data_frame = data->first_frame_with_data; } + if(data_frame >= frame_set->first_frame + frame_set->n_frames) + { + continue; + } frame_diff = data_frame - current_frame; if(frame_diff < 0) { @@ -17594,6 +17598,10 @@ tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_dat { data_frame = data->first_frame_with_data; } + if(data_frame >= frame_set->first_frame + frame_set->n_frames) + { + continue; + } frame_diff = data_frame - current_frame; if(frame_diff < 0) { |