Synced to XBMC changes from upstream
- See https://github.com/xbmc/xbmc/pull/4476 for details