Made HLS segment counter more reliable.