Repository: xbmc/xbmc
File: xbmc/cores/VideoPlayer/VideoPlayer.cpp (C++)

Code before:
  int stream = m_processInfo->GetVideoSettings().m_AudioStream;
  GetAudioStreamInfo(stream, info);
  if (!info.valid) return;
  CVariant data;
  data["player"]["playerid"] = static_cast<int>(CServiceBroker::GetPlaylistPlayer().GetCurrentPlaylist());
  CVariant contentEntry(CVariant::VariantTypeObject);
  contentEntry["index"] = stream;
  contentEntry["bitrate"] = info.bitrate;
  contentEntry["channels"] = info.channels;
  contentEntry["codec"] = info.codecDesc;
  contentEntry["isdefault"] = (info.flags & StreamFlags::FLAG_DEFAULT) != 0;
  contentEntry["isimpaired"] = (info.flags & StreamFlags::FLAG_HEARING_IMPAIRED) != 0;
  contentEntry["isoriginal"] = (info.flags & StreamFlags::FLAG_ORIGINAL) != 0;
  contentEntry["language"] = info.language;
  contentEntry["name"] = info.name;
  contentEntry["samplerate"] = info.samplerate;
  data["property"]["currentaudiostream"] = contentEntry;
  CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::Player, "OnPropertyChanged", data);
}

void CVideoPlayer::NotifyVideoUpdate()
{
  VideoStreamInfo info;
  int iStream = m_processInfo->GetVideoSettings().m_VideoStream;
  GetVideoStreamInfo(iStream, info);
  if (!info.valid) return;
  CVariant data;
  data["player"]["playerid"] = static_cast<int>(CServiceBroker::GetPlaylistPlayer().GetCurrentPlaylist());
  CVariant contentEntry(CVariant::VariantTypeObject);
  contentEntry["index"] = iStream;
  contentEntry["codec"] = info.codecName;
  contentEntry["height"] = info.height;
  contentEntry["width"] = info.width;
  contentEntry["language"] = info.language;
  contentEntry["name"] = info.name;
  data["property"]["currentvideostream"] = contentEntry;
  CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::Player, "OnPropertyChanged", data);
}


Review comment (suggestion):
OK but this doesn't follow the standard formatting for the project (other places in the PR as well)
Normally Jenkins provides a diff of the required change, I don't know why it doesn't appear for this PR.
You can also run clang-format yourself on your changes.

Code after:
}

void CVideoPlayer::SetUpdateStreamDetails()
{
  m_messenger.Put(std::make_shared<CDVDMsg>(CDVDMsg::PLAYER_SET_UPDATE_STREAM_DETAILS));
}

void CVideoPlayer::NotifySubtitleUpdate(int flags)
{
  CVariant data;
  data["player"]["playerid"] = m_item.GetProperty("playlist_type_hint").asInteger32(-1);
  if ((flags & SubtitleChange::FLAG_STATUS_CHANGE) != 0)
  {
    data["property"]["subtitleenabled"] = m_processInfo->GetVideoSettings().m_SubtitleOn;
  }
  if ((flags & SubtitleChange::FLAG_STREAMINFO_CHANGE) != 0)
  {
    const int stream = m_processInfo->GetVideoSettings().m_SubtitleStream;
    SubtitleStreamInfo info;
    GetSubtitleStreamInfo(stream, info);
    if (!info.valid)
    {
      // Only proceed if we're also sending status change
      if ((flags & SubtitleChange::FLAG_STATUS_CHANGE) == 0)
        return;
    }
    else
    {
      // Only add stream info if valid
      CVariant contentEntry(CVariant::VariantTypeObject);
      contentEntry["index"] = stream;
      contentEntry["isdefault"] = (info.flags & StreamFlags::FLAG_DEFAULT) != 0;
      contentEntry["isforced"] = (info.flags & StreamFlags::FLAG_FORCED) != 0;
      contentEntry["isimpaired"] = (info.flags & StreamFlags::FLAG_VISUAL_IMPAIRED) != 0;
      contentEntry["language"] = info.language;
      contentEntry["name"] = info.name;
      data["property"]["currentsubtitle"] = contentEntry;
    }
  }
  CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::Player, "OnPropertyChanged",
                                                     data);
}

void CVideoPlayer::NotifyAudioUpdate()
{
  AudioStreamInfo info;
  const int stream = m_processInfo->GetVideoSettings().m_AudioStream;
  GetAudioStreamInfo(stream, info);
  if (!info.valid)
    return;
  CVariant data;