Skip to content

Commit

Permalink
Make libav error message buffers thread local
Browse files Browse the repository at this point in the history
  • Loading branch information
edman007 committed Jan 18, 2021
1 parent c5e82d8 commit e2a7e01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chiton_ffmpeg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern "C" {
#ifdef av_err2str
#undef av_err2str
av_always_inline char* av_err2str(int errnum){
static char str[AV_ERROR_MAX_STRING_SIZE];
thread_local static char str[AV_ERROR_MAX_STRING_SIZE];
memset(str, 0, sizeof(str));
return av_make_error_string(str, AV_ERROR_MAX_STRING_SIZE, errnum);
}
Expand All @@ -44,7 +44,7 @@ av_always_inline char* av_err2str(int errnum){
#ifdef av_ts2timestr
#undef av_ts2timestr
av_always_inline char* av_ts2timestr(int64_t ts, AVRational * tb){
static char str[AV_TS_MAX_STRING_SIZE];
thread_local static char str[AV_TS_MAX_STRING_SIZE];
memset(str, 0, sizeof(str));
return av_ts_make_time_string(str, ts, tb);
}
Expand All @@ -53,7 +53,7 @@ av_always_inline char* av_ts2timestr(int64_t ts, AVRational * tb){
#ifdef av_ts2str
#undef av_ts2str
av_always_inline char* av_ts2str(int64_t ts){
static char str[AV_TS_MAX_STRING_SIZE];
thread_local static char str[AV_TS_MAX_STRING_SIZE];
memset(str, 0, sizeof(str));
return av_ts_make_string(str, ts);
}
Expand Down

0 comments on commit e2a7e01

Please sign in to comment.