diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-12-04 14:13:07 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-12-04 14:13:07 (GMT) |
commit | 963508543779e1b604351568e028023493e76877 (patch) | |
tree | 7ca7dfcb88fbcb951bf8f7331e5806d9eeb5c739 | |
parent | 0c6b5ba82049ed92c724d44b8451c992e8974124 (diff) |
Do not write data blocks belonging to previous frame set.
-rw-r--r-- | src/lib/tng_io.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index fb9f238..ec6298a 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -4884,7 +4884,6 @@ static tng_function_status tng_particle_data_block_write if(block_type_flag == TNG_TRAJECTORY_BLOCK) { data = &frame_set->tr_particle_data[block_index]; - stride_length = tng_max_i64(1, data->stride_length); /* If this data block has not had any data added in this frame set * do not write it. */ @@ -4892,6 +4891,8 @@ static tng_function_status tng_particle_data_block_write { return(TNG_SUCCESS); } + + stride_length = tng_max_i64(1, data->stride_length); } else { @@ -5809,6 +5810,14 @@ static tng_function_status tng_data_block_write(tng_trajectory_t tng_data, if(block_type_flag == TNG_TRAJECTORY_BLOCK) { data = &frame_set->tr_data[block_index]; + + /* If this data block has not had any data added in this frame set + * do not write it. */ + if(data->first_frame_with_data < frame_set->first_frame) + { + return(TNG_SUCCESS); + } + stride_length = tng_max_i64(1, data->stride_length); } else |