Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-ffmpeg: Commit

external/ffmpeg


Commit MetaInfo

Revisión1a8b4f42bb38375ffa3852d8015da4ff6d7384a7 (tree)
Tiempo2014-08-04 23:23:49
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

--- 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