Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-ffmpeg: Commit

external/ffmpeg


Commit MetaInfo

Revisión157155f3874105eaba4a70496fe6d84d037a962d (tree)
Tiempo2014-02-04 14:57:06
AutorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

libavutil: fix av_err2str compiling error for C++

The implementation may not be thread-safe. But good enough for us.

Cambiar Resumen

Diferencia incremental

--- a/libavutil/error.h
+++ b/libavutil/error.h
@@ -87,6 +87,17 @@
8787 */
8888 int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
8989
90+#ifdef __cplusplus
91+
92+static inline const char *av_err2str(int errnum)
93+{
94+ static char errbuf[AV_ERROR_MAX_STRING_SIZE];
95+ av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE);
96+ return errbuf;
97+}
98+
99+#else
100+
90101 /**
91102 * Fill the provided buffer with a string containing an error string
92103 * corresponding to the AVERROR code errnum.
@@ -110,6 +121,7 @@ static inline char *av_make_error_string(char *errbuf, size_t errbuf_size, int e
110121 #define av_err2str(errnum) \
111122 av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum)
112123
124+#endif /* __cplusplus */
113125 /**
114126 * @}
115127 */
Show on old repository browser