fixed frame length calculation when writing to disk