RTSP and StopThread() mods ported across from RTSP_dev branch