Now and as in the past centuries, in the Navy, the term Captain referred to a position on board a ship as well as a rank. Generally, those officers who commanded a ship were called CAPT regardless of the officer's actual rank. During the early 19th Century the Royal Navy rank of Commander fell between Lieutenant and CAPT. Larger RN ships would employ a Sailing Master, a professional & expert who tended to the navigation of a sailing vessel.
Generally during the period of the film, CDRs wore only one gold shoulder strap on the left shoulder. CAPTs wore the strap on the right shoulder until they served three years after which they wore them on both shoulders.
The RN assigned CDRs and at times LTs to command smaller ships. For example, when William Bligh was the Captain of the HMAV BOUNTY, he held the rank of LT. Those with the rank of CDR and charged with a ship were referred to as "Master and Commander" for the one officer would serve as the both the captain & sailing master. In the film a Sailing Master works among the crew and Russell Crowe's character wore two straps.