summaryrefslogtreecommitdiff
path: root/src/lib/tng_io.c
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2014-04-22 11:10:35 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2014-05-05 07:04:22 (GMT)
commit06704fc87c27a67f25c5d19c39f0ef3d2b49ca77 (patch)
treebf7bfda10fd2d5b775c90406de8e6e5d267543bf /src/lib/tng_io.c
parentdc27454d8dfd0d5589f0ed6ba8e15e5d69dcb9df (diff)
Check if number of written frames should be updated.
When reading a frame set the number of written frames in the frame set should only be updated if the output file and the input files are the same. This fixes a bug in one of the tests in tng_testing. Change-Id: Ia21d501b9723f756dfccf75e5d5bbac606cdc582
Diffstat (limited to 'src/lib/tng_io.c')
-rw-r--r--src/lib/tng_io.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index 658f9e4..180d339 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -3611,7 +3611,14 @@ static tng_function_status tng_frame_set_block_read
tng_data->time_per_frame = -1;
}
- frame_set->n_written_frames = frame_set->n_frames;
+ /* If the output file and the input files are the same the number of
+ * frames in the file are the same number as has just been read.
+ * This is updated here to later on see if there have been new frames
+ * added and thereby the frame set needs to be rewritten. */
+ if(tng_data->output_file == tng_data->input_file)
+ {
+ frame_set->n_written_frames = frame_set->n_frames;
+ }
return(TNG_SUCCESS);
}
contact: Jan Huwald // Impressum