Repository: xbmc/xbmc
File: xbmc/PlayListPlayer.cpp (C++)

Code before:
      CFileItemList *list = static_cast<CFileItemList*>(pMsg->lpVoid);

      if (list->Size() > 0)
      {
        Id playlistId = Id::TYPE_MUSIC;
        for (int i = 0; i < list->Size(); i++)
        {
          if (IsVideo(*list->Get(i)))
          {
            playlistId = Id::TYPE_VIDEO;
            break;
          }
        }

        ClearPlaylist(playlistId);
        SetCurrentPlaylist(playlistId);
        if (list->Size() == 1 && !IsPlayList(*list->Get(0)))
        {
          CFileItemPtr item = (*list)[0];
          // if the item is a plugin we need to resolve the URL to ensure the infotags are filled.
          if (URIUtils::HasPluginPath(*item) &&
              !XFILE::CPluginDirectory::GetResolvedPluginResult(*item))
          {
            return;
          }
          const bool isVideo{IsVideo(*item)};
          const bool isAudio{MUSIC::IsAudio(*item)};
          if (isAudio || isVideo)
          {
            if ((isVideo && !g_passwordManager.IsVideoUnlocked()) ||
                (isAudio && !g_passwordManager.IsMusicUnlocked()))
            {
              CLog::LogF(LOGERROR,
                         "MasterCode or MediaSource-code is wrong: {} will not be played.",
                         item->GetPath());
              return;
            }
            Play(item, pMsg->strParam);
          }
          else
            g_application.PlayMedia(*item, pMsg->strParam, playlistId);
        }
        else
        {
          // Handle "shuffled" option if present
          if (list->HasProperty("shuffled") && list->GetProperty("shuffled").isBoolean())
            SetShuffle(playlistId, list->GetProperty("shuffled").asBoolean(), false);
          // Handle "repeat" option if present
          if (list->HasProperty("repeat") && list->GetProperty("repeat").isInteger())
            SetRepeat(playlistId, static_cast<RepeatState>(list->GetProperty("repeat").asInteger()),
                      false);

Review comment (suggestion):
i guess it is `VIDEO::IsVideo` being called here

```suggestion
          const bool isVideo{VIDEO::IsVideo(*item)};
```

Code after:
      CFileItemList *list = static_cast<CFileItemList*>(pMsg->lpVoid);

      if (list->Size() > 0)
      {
        Id playlistId = Id::TYPE_MUSIC;
        for (int i = 0; i < list->Size(); i++)
        {
          if (IsVideo(*list->Get(i)))
          {
            playlistId = Id::TYPE_VIDEO;
            break;
          }
        }

        ClearPlaylist(playlistId);
        SetCurrentPlaylist(playlistId);
        if (list->Size() == 1 && !IsPlayList(*list->Get(0)))
        {
          CFileItemPtr item = (*list)[0];
          // if the item is a plugin we need to resolve the URL to ensure the infotags are filled.
          if (URIUtils::HasPluginPath(*item) &&
              !XFILE::CPluginDirectory::GetResolvedPluginResult(*item))
          {
            return;
          }
          const bool isVideo{VIDEO::IsVideo(*item)};
          const bool isAudio{MUSIC::IsAudio(*item)};
          if (isAudio || isVideo)
          {
            if ((isVideo && !g_passwordManager.IsVideoUnlocked()) ||
                (isAudio && !g_passwordManager.IsMusicUnlocked()))
            {
              CLog::LogF(LOGERROR,
                         "MasterCode or MediaSource-code is wrong: {} will not be played.",
                         item->GetPath());
              return;
            }
            Play(item, pMsg->strParam);
          }
          else
            g_application.PlayMedia(*item, pMsg->strParam, playlistId);
        }
        else
        {
          // Handle "shuffled" option if present
          if (list->HasProperty("shuffled") && list->GetProperty("shuffled").isBoolean())
            SetShuffle(playlistId, list->GetProperty("shuffled").asBoolean(), false);
          // Handle "repeat" option if present
          if (list->HasProperty("repeat") && list->GetProperty("repeat").isInteger())
            SetRepeat(playlistId, static_cast<RepeatState>(list->GetProperty("repeat").asInteger()),
                      false);