Added as separate function so that it can be called from webvtt_finish_parsing()