remove unneeded strlen
This commit is contained in:
parent
64c601fc7b
commit
0ac3e6fd5b
|
@ -64,11 +64,15 @@ void log_libav_callback(void *ptr, int level, const char *fmt, va_list vargs) {
|
|||
|
||||
if ( log ) {
|
||||
char logString[8192];
|
||||
vsnprintf(logString, sizeof(logString)-1, fmt, vargs);
|
||||
int length = strlen(logString);
|
||||
// ffmpeg logs have a carriage return, so replace it with terminator
|
||||
logString[length-1] = 0;
|
||||
log->logPrint(false, __FILE__, __LINE__, log_level, logString);
|
||||
int length = vsnprintf(logString, sizeof(logString)-1, fmt, vargs);
|
||||
if ( length > 0 ) {
|
||||
if ( static_cast<size_t>(length) > sizeof(logString)-1 ) length = sizeof(logString)-1;
|
||||
// ffmpeg logs have a carriage return, so replace it with terminator
|
||||
logString[length-1] = 0;
|
||||
log->logPrint(false, __FILE__, __LINE__, log_level, logString);
|
||||
} else {
|
||||
log->logPrint(false, __FILE__, __LINE__, AV_LOG_ERROR, "Can't encode log from av. fmt was %s", fmt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue