[FFmpeg-devel] [PATCH v4 2/3] lavc/libdavs2.c: fix decoder info level setting

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Jul 22 08:03:14 EEST 2019


On 22.07.2019, at 06:23, hwrenx <hwrenx at 126.com> wrote:

> Mapping log level from av_log_level to davs3_log_level_e:
> 
> [AV_LOG_QUIET, AV_LOG_ERROR]   => DAVS2_LOG_ERROR
> [AV_LOG_WARNING]               => DAVS2_LOG_WARNING
> [AV_LOG_INFO]                  => DAVS2_LOG_INFO
> [AV_LOG_VERBOSE, AV_LOG_TRACE] => DAVS2_LOG_DEBUG
> 
> in values:
> 
> [-8, 16] => 3
> [17, 24] => 2
> [25, 32] => 1
> [33, 56] => 0
> 
> After clip into [AV_LOG_FATAL + 1, AV_LOG_VERBOSE]([9, 40]), davs2 log
> level can be expressed as (4-(((av_log_level)-1)>>3)).

The AV_LOG_... values might change at some point.
I'd suggest using a couple of ifs instead of trying something "clever" like this.


More information about the ffmpeg-devel mailing list