Rewrite A-B repeat in a somewhat less hideous form and otherwise simplify playback.c a bit.