Skip to content
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

Fix a huge regression which invokes the avcodec_open() twice #876

Merged
merged 2 commits into from
Nov 27, 2022

Conversation

jonoomph
Copy link
Member

Fix a huge regression which invokes the avcodec_open() twice for every call to FFmpegReader::Open(), leaving many threads running and never joined/closed. Also, adding some additional error message when attempting to call avcodec_open().

…or every call to FFmpegReader::Open(), leaving many threads running and never joined/closed. Also, adding some additional error message when attempting to call avcodec_open().
@@ -569,13 +573,13 @@ void FFmpegReader::Open() {
CheckFPS();
}

// Mark as "open"
is_open = true;

// Seek back to beginning of file (if not already seeking)
if (!is_seeking) {
Seek(1);
Copy link
Member Author

Choose a reason for hiding this comment

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

Since the Seek() method can actually Close() and re Open() this reader, it's important we mark the reader as is_open = True before doing this... so our Close method can actually clean up the open reader.

@codecov
Copy link

codecov bot commented Nov 27, 2022

Codecov Report

Merging #876 (520446c) into develop (bcd54c0) will decrease coverage by 0.00%.
The diff coverage is 50.00%.

@@             Coverage Diff             @@
##           develop     #876      +/-   ##
===========================================
- Coverage    51.86%   51.86%   -0.01%     
===========================================
  Files          187      187              
  Lines        16335    16338       +3     
===========================================
+ Hits          8472     8473       +1     
- Misses        7863     7865       +2     
Impacted Files Coverage Δ
src/FFmpegReader.cpp 72.94% <50.00%> (-0.12%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jonoomph
Copy link
Member Author

@jonoomph jonoomph merged commit 6f80011 into develop Nov 27, 2022
@jonoomph jonoomph deleted the fix-double-avcodec-open branch November 27, 2022 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant