I was plagued by this for a while but there IS a way to prevent it. You can't have your video player open or minimized in the doc before you turn on airplay mirroring. If it's opened in the doc or actively running at all, you need to close it out completely by selecting quit from the toolbar. Then you need to turn off airplay. Once BOTH airplay and all your video programs are closed out, you can go back in and turn airplay back on. You can then open your video and sound should work. To prevent this problem in the future, you just need to make sure you turn on mirroring FIRST before opening your video player.
Remember too, that with a mac, most programs including quicktime, run in the background until you actively quit them. Clicking on the red circle doesn't quit the program. You need to select quit from the toolbar menu.
This "fix" isn't ideal of course, but once you get used to the fact that you have to turn on mirroring first, its really no extra work. You don't have to mess with any audio settings or do any restarts. It's just a matter of remembering the right order. Hope this helps people.