A system and computer program product for controlling the supply of a distending media (such as an insufflating gas) from a distending media source (110) to an endoscopic device (130) so as to prevent the excess venting and/or waste of distending media is disclosed. More specifically it provides for the detection of a pressure level within a lumen (124) of an endoscopic device (130) and adjusts a supply parameter of the distending media based at least in part on the detected pressure level, and in some cases on the relationship between the detected pressure level and a user-defined threshold.