I’ve accepted @EightAndAHalfTails’ answer because it is a valid solution.
However my original solution was where B speaks and it is dependent on C’s silence.
But the accepted solution is dependent on B’s silence so what is the correct answer?
I suppose it is whoever’s logic is quicker...
Anyway, here’s the alternative solution assuming C doesn’t speak before B.
B knows that A isn’t speaking - either because A sees two of each color in front of him or A is mute.
B sees one red hat in front of him on D. So B’s only hope to be the one to answer is to deduce that D is actually the mute.
C doesn’t speak at this point either (and remember we’re assuming he doesn’t speak before B).
B reasons the following:
“Suppose D is not mute.
D realizes that C and D cannot both be white otherwise A or B would have certainly spoken. So C and D must be red and red, red and white, or white and red.
D also realizes the only case where he is white (C red and D white) is the exact same scenario as the last game. In which case B would speak if C is mute, and C would speak if C is not mute.
Since this doesn’t happen D would realize that this case (C red and D white) must not be true. Therefore one of the other two cases must be true (red and red, or white and red). In either case D is red and he would announce this as his color.
Since D has not announced this, he must be mute and therefore A is not mute.
And therefore A sees two of each color in front of him.
Therefore I am red!”
Since this answer appears to have more steps than EightAndAHalfTails’ answer, then B would actually not speak before C.
However if we choose to believe that these prisoners have instantaneous god-like logic, then we come to a loop where no one can answer. How interesting!