If Winlirc works fine then I suggest you use it. I couldn't get WinLIRC to work while any video was playing.

I suppose the problem you are seeing could be coming from one of several sources:
1. you have a slow cpu that cannot keep up. Try running a compiled version of the code.
2. try changing the adjustable parameters in the code.