When the stranger (Black Dog) arrives at the inn, the Captain looks like he has seen a ghost. After telling the Jim to leave, the two talk together in low voices. The only thing that the boy overhears is the captain speaking about all "swinging," (meaning hanging), before there is a loud commotion. After the outcry, Black Dog, with a cut on his shoulder flees, the captain pursues him, both with drawn cutlasses. The captain aims at Black Dog but misses and hits the inn's signboard instead, leaving Black Dog to escape.
From the text, we can infer that the Captain has been hiding out, and that he is afraid of what will happen if his shipmates find him.