avformat/hls: avoid floating point arithmetic