[Solved] error: taking address of temporary array av_make_error_string((char[AV_ERROR_MAX_STRING_SI…




/**
 * Convenience macro, the return value should be used only directly in
 * function arguments but never stand-alone.
 */
//#define av_err2str(errnum) \
 //   av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum)

//Modify as the following:


av_always_inline char* av_err2str(int errnum)
{
    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);
}

Modify libavutil/error.h:132 as the above.

Read More: