The present invention is directed to a system, method, and computer program productfor controlling the supply of a distending media (such as an insufflating gas)from a distending media source to an endoscopic device so as to prevent the excessventing and/or waste of distending media. More specifically the present inventionprovides for the detection of a pressure level within a lumen of an endoscopicdevice and adjusts a supply parameter of the distending media based at least inpart on the detected pressure level, and in some cases on the relationship betweenthe detected pressure level and a user-defined threshold.