From 06704fc87c27a67f25c5d19c39f0ef3d2b49ca77 Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Tue, 22 Apr 2014 13:10:35 +0200 Subject: 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 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); } -- cgit v0.10.1