[libbluray-devel] Fix check for app-provided log function
hpi1
git at videolan.org
Thu May 4 13:46:54 CEST 2017
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu May 4 12:14:09 2017 +0300| [8d739e88df1ac337e949c4bb01852a8ed5de895f] | committer: hpi1
Fix check for app-provided log function
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=8d739e88df1ac337e949c4bb01852a8ed5de895f
---
src/util/logging.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/util/logging.c b/src/util/logging.c
index 62e6b59f..94ef131e 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -84,6 +84,7 @@ void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...
char buffer[4096];
va_list args;
int len, len2;
+ BD_LOG_FUNC lf;
len = sprintf(buffer, "%s:%d: ", f ? f + 1 : file, line);
if (len < 0) {
@@ -97,10 +98,10 @@ void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...
if (len2 < 0) {
return;
}
-
- if (log_func) {
+ lf = log_func;
+ if (lf) {
buffer[sizeof(buffer)-1] = 0;
- log_func(buffer);
+ lf(buffer);
} else {
len += len2;
More information about the libbluray-devel
mailing list