xbmc/xbmc — comment on commit 4f3fc2d8b473f9b3ba683cd93f08ca64b88cc66b
File:  line 0
By elupus:

Looks pretty good, but it suffers a race condition. You need to lock m_init_csection in AddPackets and the other lot too. The alternative is to just set the reinit flag in the callback and actually do the reinitialize on first access by dvdplayer thread, that avoids locks.

Then the re-init would happen in dvdplayer's thread instead of gui thread after a small delay.