From 88707939328087c5b439c072ae3c2bb0e4e1073c Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Fri, 29 Nov 2013 11:09:43 +0100 Subject: Improved *_next_frame_read() diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index f798b7c..0eb6d20 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -15728,8 +15728,13 @@ tng_function_status DECLSPECDLLEXPORT tng_util_particle_data_next_frame_read stat = tng_frame_set_of_frame_find(tng_data, i); if(stat != TNG_SUCCESS) { + printf("Cannot find frame set of frame %"PRId64". %s: %d\n", + frame_set->first_frame + i, __FILE__, __LINE__); return(stat); } + } + if(data->last_retrieved_frame < frame_set->first_frame) + { stat = tng_frame_set_read_current_only_data_from_block_id(tng_data, TNG_USE_HASH, block_id); if(stat != TNG_SUCCESS) { @@ -15864,6 +15869,9 @@ tng_function_status DECLSPECDLLEXPORT tng_util_non_particle_data_next_frame_read frame_set->first_frame + i, __FILE__, __LINE__); return(stat); } + } + if(data->last_retrieved_frame < frame_set->first_frame) + { stat = tng_frame_set_read_current_only_data_from_block_id(tng_data, TNG_USE_HASH, block_id); if(stat != TNG_SUCCESS) { -- cgit v0.10.1