H.M.S. Defiant (1962)
This 1962 British film, set aboard a warship during the Napoleonic Wars, features Alec Guinness as the captain and Dirk Bogarde as a sadistic officer. The vengeful Bogarde schemes to have the captain's son, a young midshipman, caned for various petty offences and even contrives for the Captain to witness his son 'kissing the gunner's daughter' (naval terminology for bending across a cannon to be beaten).