summaryrefslogtreecommitdiff
path: root/src/lib/tng_io.c
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2014-09-26 11:13:01 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2014-09-26 11:16:32 (GMT)
commitecd5608f938835effe1c6058ab100d61219180f0 (patch)
tree41fb7b3e4f460bb521eea7e9176eb81e3423807c /src/lib/tng_io.c
parentf007cd2af2835106bfe4ee5baff8f6962dd3f73c (diff)
Added tng_util_num_frames_with_data_of_block_id_get()
The function already existed in the tng_io.c, but has now been exposed through the API. Basic code for testing it was added as well. Version bumped to 1.7.0 Change-Id: Ia276ce3c7c9225f5d0d07eb6e3cd4cea6b882d24
Diffstat (limited to 'src/lib/tng_io.c')
-rw-r--r--src/lib/tng_io.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index 1f68388..bb6c26a 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -17635,7 +17635,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_num_frames_with_data_of_block_id_
stat = tng_frame_set_n_frames_of_data_block_get(tng_data, block_id, &curr_n_frames);
- while(stat == TNG_SUCCESS)
+ while(stat == TNG_SUCCESS && tng_data->current_trajectory_frame_set.next_frame_set_file_pos != -1)
{
*n_frames += curr_n_frames;
fseeko(tng_data->input_file,
@@ -17643,6 +17643,10 @@ tng_function_status DECLSPECDLLEXPORT tng_util_num_frames_with_data_of_block_id_
SEEK_SET);
stat = tng_frame_set_n_frames_of_data_block_get(tng_data, block_id, &curr_n_frames);
}
+ if(stat == TNG_SUCCESS)
+ {
+ *n_frames += curr_n_frames;
+ }
fseeko(tng_data->input_file, curr_file_pos, SEEK_SET);
if(stat == TNG_CRITICAL)
{
contact: Jan Huwald // Impressum