lavf/segment: only use reference frames for computing the segment end time