Use libcod to monitor who a player is spectating, then force the player to spectate the NEXT available player using something like this:

{ill post some code later today}