added caps replacement code for fake decoder.

*Note: do not regard this version of fakedecoder as stable.