From 58756626184437613b7fee705afc8e69077ea6fc Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Mon, 26 May 2014 17:41:51 +0200 Subject: 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 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); -- cgit v0.10.1