Occasionally I have problems with playing videos or listening to internet music when I airplay from my macbook to the AppleTV. But if I listen to music through iTunes it will play fine through the TV. One way I've been able to get it working again is to run this command from the terminal (then entering password):
sudo killall coreaudiod
A reboot also sorts the problem out too when all else fails - but that's not very elegant, is it?