Streaming stops after a few minutes – Raspberry Pi

On a few of my streams, they stop after a few minutes. Not all of them do. Live TV does almost all the time. Is there something I can do to prevent this? I use Kodi on OpenElec through Raspberry Pi