1. Check out your logs: ~/.kodi/temp/kodi.log OR ~/.xbmc/temp/xbmc.log
Try running tail -f yourlogfile and playing the file giving you the problem. If something like this appears:
00:16:50 T:1257443248 ERROR:
COMXCoreComponent::DecoderEventHandler OMX.broadcom.resize -
OMX_ErrorInsufficientResources, insufficient resources
You need to adjust the pi boot config.
2. Edit boot config, e.g. - sudo nano /boot/config.txt
Change the value for gpu_mem_256 to 192. Any higher is probably going to cause other problems. If you have a B+ pi, change the value for gpu_mem_512 to a minimum of 192. It can probably be set higher safely, but 192 always worked fine for me.
3. sudo shutdown -r now
4. Retry playing your content!