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
FFmpeg: Create, use av_err2string() #689
Conversation
- Previously 'av_make_error_string' was defined in FFmpegUtilities.h for the sole purpose of redefining `av_err2str()` as a call to that function. `av_err2str()` was then used in our code, often in string contexts where its output was cast to `std::string`. - Since that was excessively circular, instead the function is named `av_err2string()`, and it's used directly in contexts where a std::string is expected. - `av_err2str()` is still #defined as `av_err2string(...).c_str()`
Codecov Report
@@ Coverage Diff @@
## develop #689 +/- ##
===========================================
- Coverage 50.40% 50.39% -0.01%
===========================================
Files 155 155
Lines 13291 13292 +1
===========================================
Hits 6699 6699
- Misses 6592 6593 +1
Continue to review full report at Codecov.
|
Merge conflicts have been detected on this PR, please resolve. |
Merge conflicts have been detected on this PR, please resolve. |
I have no idea why I haven't merged this yet, so... doing so. |
- Previously 'av_make_error_string' was defined in FFmpegUtilities.h for the sole purpose of redefining `av_err2str()` as a call to that function. `av_err2str()` was then used in our code, often in string contexts where its output was cast to `std::string`. - Since that was excessively circular, instead the function is named `av_err2string()`, and it's used directly in contexts where a std::string is expected. - `av_err2str()` is still #defined as `av_err2string(...).c_str()`
- Previously 'av_make_error_string' was defined in FFmpegUtilities.h for the sole purpose of redefining `av_err2str()` as a call to that function. `av_err2str()` was then used in our code, often in string contexts where its output was cast to `std::string`. - Since that was excessively circular, instead the function is named `av_err2string()`, and it's used directly in contexts where a std::string is expected. - `av_err2str()` is still #defined as `av_err2string(...).c_str()`
- Previously 'av_make_error_string' was defined in FFmpegUtilities.h for the sole purpose of redefining `av_err2str()` as a call to that function. `av_err2str()` was then used in our code, often in string contexts where its output was cast to `std::string`. - Since that was excessively circular, instead the function is named `av_err2string()`, and it's used directly in contexts where a std::string is expected. - `av_err2str()` is still #defined as `av_err2string(...).c_str()`
(Note: Split out of #661)
My commit message for this reads:
for the sole purpose of redefining
av_err2str()
as a call to thatfunction.
av_err2str()
was then used in our code, often in stringcontexts where its output was cast to
std::string
.av_err2string()
, and it's used directly in contexts where astd::string is expected.
av_err2str()
is still #defined asav_err2string(...).c_str()
What actually happened was worse than I made it sound:
av_make_error_string()
wrapped FFmpeg'sav_strerror()
to return astd::string
, for C++ compatibilityav_err2str()
was then redefined:char*
version ofav_make_error_string()
MostAll uses ofav_err2str(errnum)
in the code were then written asLike I said, dizzyingly circular. So all of those
(std::string)av_err2str(errnum)
s are now replaced withav_err2string(errnum)
. No casting needed.