drop log messages with not supported encoding on apple platforms, fixes #596

This commit is contained in:
Taner Sener 2022-10-18 19:28:29 +01:00
parent a5ed0bde5b
commit 1089101e77

View File

@ -487,7 +487,12 @@ void ffmpegkit_statistics_callback_function(int frameNumber, float fps, float qu
void process_log(long sessionId, int levelValue, AVBPrint* logMessage) { void process_log(long sessionId, int levelValue, AVBPrint* logMessage) {
int activeLogLevel = av_log_get_level(); int activeLogLevel = av_log_get_level();
Log* log = [[Log alloc] init:sessionId:levelValue:[NSString stringWithCString:logMessage->str encoding:NSUTF8StringEncoding]]; NSString* message = [NSString stringWithCString:logMessage->str encoding:NSUTF8StringEncoding];
if (message == nil) {
// WE DROP LOGS THAT WE CANNOT DISPLAY
return;
}
Log* log = [[Log alloc] init:sessionId:levelValue:message];
BOOL globalCallbackDefined = false; BOOL globalCallbackDefined = false;
BOOL sessionCallbackDefined = false; BOOL sessionCallbackDefined = false;
LogRedirectionStrategy activeLogRedirectionStrategy = globalLogRedirectionStrategy; LogRedirectionStrategy activeLogRedirectionStrategy = globalLogRedirectionStrategy;