-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Attempt to fix FFMPEG 5.0 compatibility #5644
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
Conversation
💊 CI failures summary and remediationsAs of commit 3c7e998 (more details on the Dr. CI page):
1 failure not recognized by patterns:
This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
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.
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.
I have imported the PR and pointed out a few things to be considered.
// update 03/22: moving memory management to ffmpeg | ||
AVPacket* avPacket; | ||
avPacket = av_packet_alloc(); | ||
if (avPacket == NULL) { |
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.
can this NULL be replaced by nullptr? the internal linter CLANGTID
is complaining about this line
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.
Should we return inside this if-clause, otherwise we will access the NULL pointer in the next line.
@bjuncek I made a few changes in an attempt to fix the memory leak and the static code analysis warnings, but there are a few things that came up that would need discussion when you are back as you will probably have more context:
|
Yup, have added the changes; this is something you might need checking in FB infra as subtitle stream was (yet) not used in TV, but might have been used internally (I've been long gone).
My understanding in this case is the same as yours, and I do thing we'd need both; do these changes pass the static memory leak checks? |
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.
LOG(ERROR) | ||
<< "decoder as not able to allocate the subtitle-specific packet."; | ||
// alternative to ENOMEM | ||
return AVERROR_BUFFER_TOO_SMALL; |
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.
Should we align the error code with the corresponding bit in decoder.cpp
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.
@jdsgomes The two methods return different enums. Originally Bruno had them synced; no strong opinions on my side.
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.
@jdsgomes would you like me to change it to match?
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.
I would prefer for consistency, unless there is a reason not to. Other than that the PR looks good and the internal tests are passing. Thank you for these changes
@@ -43,21 +43,34 @@ int SubtitleStream::initFormat() { | |||
int SubtitleStream::analyzePacket(const AVPacket* packet, bool* gotFrame) { | |||
// clean-up | |||
releaseSubtitle(); | |||
|
|||
// FIXME: should this even be created? |
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.
agree - I am also not sure if this should be created. Is the plan to follow up on this?
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.
Yes, but I think this would require a bit of coordination on Meta's side, as this is not used nor tested in TV.
For reference the internal tests are passing: https://www.internalfb.com/diff/D35115411 |
@datumbox I'll leave it up to you to decide if it's ready for merge. |
I have a nit regarding he return codes but definitely non blocking. |
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.
@bjuncek LGTM, thanks!
@jdsgomes I agree that a good API should align the return error codes across functions. I'm OK if you want to merge this now and follow up in a new PR. I'm also OK if you want to push the change directly on this branch. I leave it to you how we should proceed. At any case, we should merge this soon. We are already a week with broken CI and the issue is masking other potential problems that are not reported to the release engineering team.
Summary: * fix for FFMPEG 5.0 * Attempt to fix memory leak * early stop when mem alloc fails * fix c lint error * fix bug * revert changes * remove incorrect av_packet_free * add `av_packet_free` to subtitle stream * Addressing subtitle stream comments * addressing decoder changes * nit * addressing datumbox concernsz * averror push * addressing comments * Apply suggestions from code review * add new error code to documentation * re-introducing timeout * fix c++ syntax (Note: this ignores all push blocking failures!) Reviewed By: datumbox Differential Revision: D35216769 fbshipit-source-id: e3489471406663c8e71fc239164a682993771db3 Co-authored-by: Bruno Korbar <[email protected]> Co-authored-by: Vasilis Vryniotis <[email protected]> Co-authored-by: Joao Gomes <[email protected]> Co-authored-by: Joao Gomes <[email protected]>
* fix for FFMPEG 5.0 * Attempt to fix memory leak * early stop when mem alloc fails * fix c lint error * fix bug * revert changes * remove incorrect av_packet_free * add `av_packet_free` to subtitle stream * Addressing subtitle stream comments * addressing decoder changes * nit * addressing datumbox concernsz * averror push * addressing comments * Apply suggestions from code review * add new error code to documentation * re-introducing timeout * fix c++ syntax Co-authored-by: Bruno Korbar <[email protected]> Co-authored-by: Vasilis Vryniotis <[email protected]> Co-authored-by: Joao Gomes <[email protected]> Co-authored-by: Joao Gomes <[email protected]> (cherry picked from commit da03f51)
Attempting to address #5616 via simple API update.
Should be properly tested in FB internals.
cc @datumbox