Don't bother with codecs, it's a waste of energy. Simply google VLC media player. That plays anything you throw at it, essentially, unless the file is corrupted. WMP is good for playing music and wmv videos, and that's it.
And just FYI, the torrent is sort of a go between for the file you're downloading and the "tracker" you're downloading the file from. So you don't try to play the .torrent, if that's what you're doing, because the torrent isn't the file you're trying to get, rather, the path. So the problem you're having is playing .avi files, not torrent files.
But yeah, use VLC.