-
Notifications
You must be signed in to change notification settings - Fork 254
[PropertiesUtils] Add streams_config property #1250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
CastagnaIT
wants to merge
2
commits into
xbmc:Omega
Choose a base branch
from
CastagnaIT:stream_lang_flags
base: Omega
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -68,6 +68,8 @@ namespace adaptive | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
void AdaptiveTree::PostOpen(const UTILS::PROPERTIES::KodiProperties& kodiProps) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FixStreamsFlags(kodiProps); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// A manifest can provide live delay value, if not so we use our default | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// value of 16 secs, this is needed to ensure an appropriate playback, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// an add-on can override the delay to try fix edge use cases | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -374,4 +376,148 @@ namespace adaptive | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
m_cvWait.notify_all(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
void AdaptiveTree::FixStreamsFlags(const UTILS::PROPERTIES::KodiProperties& kodiProps) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Add-ons can override subtitles "default" flag to streams | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!kodiProps.m_subtitleLangDefault.empty()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (auto& period : m_periods) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (auto& adpSet : period->GetAdaptationSets()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (adpSet->GetStreamType() == StreamType::SUBTITLE) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
adpSet->SetIsDefault( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STRING::CompareNoCase(adpSet->GetLanguage(), kodiProps.m_subtitleLangDefault)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Add-ons can override audio "original" flag to streams | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!kodiProps.m_audioLangOriginal.empty()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (auto& period : m_periods) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (auto& adpSet : period->GetAdaptationSets()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (adpSet->GetStreamType() == StreamType::AUDIO) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
adpSet->SetIsOriginal( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
STRING::CompareNoCase(adpSet->GetLanguage(), kodiProps.m_audioLangOriginal)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Audio streams "default" flag customization / workaround | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Manifest of video services dont always set appropriately the default stream flag and also | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// the manifest "default" stream flag dont have always the same meaning of Kodi track "default" flag, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// this can lead to wrong audio track selected when playback start. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// A good example is when "Media default" Kodi audio setting is set, where kodi expects just | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// a single track with the default flag. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Another problem is when video services provide multiple audio streams with same language code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// but differents channels, most of the times we can have 1 stereo and 1 multichannels | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// stream with same language code, rarely there are multi-codecs with same channels, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// but we simplify by ignoring codec types. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// To allow Kodi VP to do a better track auto-selection we need: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// - Set default flag to a single track only | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// - Set default flag to stereo or multichannels track, not both | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// to do this its needed that an addon specify what to do because C++ interface dont provide | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// access to kodi language settings where python can do it, then we cant automatize it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const std::string langCodeDef = kodiProps.m_audioLangDefault; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const std::string langCodeOrig = kodiProps.m_audioLangOriginal; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!langCodeDef.empty() || !langCodeOrig.empty()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool isDefaultStereo = kodiProps.m_audioPrefStereo; // add-on based setting | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (auto& period : m_periods) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
auto& adpSets = period->GetAdaptationSets(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
auto itAudioStream = adpSets.cend(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Try give priority to "impaired" streams | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (kodiProps.m_audioPrefType == "impaired") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (isDefaultStereo) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeDef, true, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (itAudioStream == adpSets.cend()) // No stereo stream, find multichannels | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeDef, false, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeDef, false, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (itAudioStream == adpSets.cend()) // No multichannels stream, find stereo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeDef, true, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// No stream found, try find a "impaired" stream with the "original" language code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (itAudioStream == adpSets.cend() && !langCodeOrig.empty()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (isDefaultStereo) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeOrig, true, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (itAudioStream == adpSets.cend()) // No stereo stream, find multichannels | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeOrig, false, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeOrig, false, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (itAudioStream == adpSets.cend()) // No multichannels stream, find stereo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeOrig, true, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+445
to
+472
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] There is a noticeable duplication between the stereo and multichannel selection logic; refactoring this section could improve clarity and maintainability.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Try find a stream with specified lang code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (kodiProps.m_audioPrefType != "original" && itAudioStream == adpSets.cend() && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
!langCodeDef.empty()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (isDefaultStereo) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeDef, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (itAudioStream == adpSets.cend()) // No stereo stream, find multichannels | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeDef, false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeDef, false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (itAudioStream == adpSets.cend()) // No multichannels stream, find stereo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeDef, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// No stream found, try find a stream with the "original" language code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (itAudioStream == adpSets.cend() && !langCodeOrig.empty()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (isDefaultStereo) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeOrig, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (itAudioStream == adpSets.cend()) // No stereo stream, find multichannels | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeOrig, false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeOrig, false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (itAudioStream == adpSets.cend()) // No multichannels stream, find stereo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itAudioStream = CAdaptationSet::FindAudioAdpSet(adpSets, langCodeOrig, true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Update "default" flags | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (itAudioStream != adpSets.cend()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (auto& adpSet : adpSets) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
adpSet->SetIsDefault(adpSet.get() == itAudioStream->get()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} // namespace adaptive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider checking that the vector returned by GetRepresentations() is not empty before accessing its first element to avoid potential out-of-range errors.
Copilot uses AI. Check for mistakes.