Skip to content

Better variable names for scanFileAndUpdateMetadataAndIndex #454

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

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

NicolasHug
Copy link
Member

In scanFileAndUpdateMetadataAndIndex, we use the variable name stream to denote 3 different kinds of objects:

  • StreamMetadata
  • AVStream
  • StreamInfo

I personally find this particularly confusing when reading the code, because this forces me to look at the variable declaration (in the best case), or at the function declaration (when auto is used) to figure out what the type is.

This PR renames the single stream name into:

  • streamMetadata
  • avStream
  • streamInfo

I propose to align the entire code-base to these names (for future PRs).

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 20, 2025
for (size_t i = 0; i < containerMetadata_.streams.size(); ++i) {
auto& streamMetadata = containerMetadata_.streams[i];
auto stream = formatContext_->streams[i];
for (size_t streamIndex = 0; streamIndex < containerMetadata_.streams.size();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also renamed i to streamIndex since streamIndex is already (and properly) used just above, and just below.

@NicolasHug NicolasHug merged commit 4f3e491 into pytorch:main Jan 21, 2025
44 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants