Be careful using Trainline. Renfe may not change your ticket if you want to take either an earlier or a later train. If you buy it from Trainline, you have to negotiate with them - which might not be all that easy if you’re at a station just wanting to rearrange your ticket.