diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2014-05-26 15:41:51 (GMT) |
---|---|---|
committer | Magnus Lundborg <magnus.lundborg@scilifelab.se> | 2014-05-28 10:28:52 (GMT) |
commit | 58756626184437613b7fee705afc8e69077ea6fc (patch) | |
tree | d51e4564da653c4832528021410eec2907e84dbb | |
parent | 622d4c8d54fb74113e31944d505f28b933efeb49 (diff) |
Handle one frame frame sets when reading data.
Do not use the stride length if the frame set only contains
one frame.
Change-Id: I2fc98f6f405385dcf12c1da8a946cf0ad99a6ff7
-rw-r--r-- | src/lib/tng_io.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index fea8ad0..92d728a 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -17063,7 +17063,14 @@ tng_function_status DECLSPECDLLEXPORT tng_util_particle_data_next_frame_read } else { - i = data->last_retrieved_frame + data->stride_length; + if(data->n_frames == 1) + { + i = data->last_retrieved_frame + 1; + } + else + { + i = data->last_retrieved_frame + data->stride_length; + } if(i < frame_set->first_frame || i >= frame_set->first_frame + frame_set->n_frames) { stat = tng_frame_set_of_frame_find(tng_data, i); @@ -17216,7 +17223,14 @@ tng_function_status DECLSPECDLLEXPORT tng_util_non_particle_data_next_frame_read } else { - i = data->last_retrieved_frame + data->stride_length; + if(data->n_frames == 1) + { + i = data->last_retrieved_frame + 1; + } + else + { + i = data->last_retrieved_frame + data->stride_length; + } if(i < frame_set->first_frame || i >= frame_set->first_frame + frame_set->n_frames) { stat = tng_frame_set_of_frame_find(tng_data, i); |