summaryrefslogtreecommitdiff
path: root/src/lib/tng_io.c
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-15 10:08:29 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-15 10:08:29 (GMT)
commitcdd8248f24c32c06caeeea9c95df456ebddb7cc6 (patch)
tree174b467d572792405e4bcdb4900cf59a13119cf2 /src/lib/tng_io.c
parent9c3ed04af1421c51774d5146205372017bb8d61f (diff)
Fix frame_set_of_frame_find()
Make the function work even if there are gaps between frame sets.
Diffstat (limited to 'src/lib/tng_io.c')
-rw-r--r--src/lib/tng_io.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index 0cd0744..61e1518 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -10403,7 +10403,7 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
{
int64_t first_frame, last_frame, n_frames_per_frame_set;
int64_t long_stride_length, medium_stride_length;
- int64_t file_pos;
+ int64_t file_pos, temp_frame;
tng_trajectory_frame_set_t frame_set;
tng_gen_block_t block;
tng_function_status stat;
@@ -10420,6 +10420,15 @@ tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find
medium_stride_length = tng_data->medium_stride_length;
tng_block_init(&block);
+ if(tng_first_frame_nr_of_next_frame_set_get(tng_data, &temp_frame) ==
+ TNG_SUCCESS)
+ {
+ if(temp_frame - first_frame > n_frames_per_frame_set)
+ {
+ n_frames_per_frame_set = temp_frame - first_frame;
+ }
+ }
+
/* Is this the right frame set? */
if(first_frame <= frame && frame <= last_frame)
{
contact: Jan Huwald // Impressum