From a8baceeb2ddf54c346becea38fcd2bd0a4193f31 Mon Sep 17 00:00:00 2001 From: tobigun Date: Wed, 27 Aug 2008 09:44:55 +0000 Subject: FFmpeg is very verbose and shows a bunch of errors. Those errors (they can be considered as warnings by us) can be ignored as they do not give any useful information. There is no solution to fix this except for turning error-messages off. They can be enabled if EnableFFmpegErrorOutput (in UAudioDecoder_FFMpeg) is defined (undefined by default). git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1294 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UAudioDecoder_FFMpeg.pas | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Game/Code') diff --git a/Game/Code/Classes/UAudioDecoder_FFMpeg.pas b/Game/Code/Classes/UAudioDecoder_FFMpeg.pas index a9c5863b..e81acf80 100644 --- a/Game/Code/Classes/UAudioDecoder_FFMpeg.pas +++ b/Game/Code/Classes/UAudioDecoder_FFMpeg.pas @@ -21,6 +21,12 @@ interface {.$DEFINE DebugFFMpegDecode} +// FFmpeg is very verbose and shows a bunch of errors. +// Those errors (they can be considered as warnings by us) can be ignored +// as they do not give any useful information. +// There is no solution to fix this except for turning them off. +{.$DEFINE EnableFFmpegErrorOutput} + implementation uses @@ -1060,6 +1066,22 @@ begin //Log.LogStatus('InitializeDecoder', 'UAudioDecoder_FFMpeg'); FFMpegCore := TMediaCore_FFMpeg.GetInstance(); av_register_all(); + + // Do not show uninformative error messages by default. + // FFmpeg prints all error-infos on the console by default what + // is very confusing as the playback of the files is correct. + // We consider these errors to be internal to FFMpeg. They can be fixed + // by the FFmpeg guys only and do not provide any useful information in + // respect to USDX. + {$IFNDEF EnableFFmpegErrorOutput} + {$IF LIBAVUTIL_VERSION_MAJOR >= 50} + av_log_set_level(AV_LOG_FATAL); + {$ELSE} + // FATAL and ERROR share one log-level, so we have to use QUIET + av_log_set_level(AV_LOG_QUIET); + {$IFEND} + {$ENDIF} + Result := true; end; -- cgit v1.2.3