[MPlayer-dev-eng] [PATCH] ad_ffmpeg does not honor log level

Diego Biurrun diego at biurrun.de
Sat Aug 21 15:41:54 CEST 2010


On Fri, Aug 20, 2010 at 02:45:27PM -0400, Vlad Seryakov wrote:
> 
> On Aug 20, 2010, at 4:46 AM, Diego Biurrun wrote:
> 
> >> --- libmpcodecs/ad_ffmpeg.c	(revision 31984)
> >> +++ libmpcodecs/ad_ffmpeg.c	(working copy)
> >> @@ -99,6 +99,18 @@
> >> +      switch(verbose){
> > 
> > switch (verbose) {

Please don't ignore my comments.

> >> +      case 7:
> >> +      case 8:
> >> +      case 9:
> >> +      case 10: av_log_set_level(AV_LOG_VERBOSE); break;
> >> +      }
> > 
> > This could use a default case.
> > 
> I am not sure if INFO is a good choice for default but this is what is
> default in avutil/log.c so at least it preserves default logging level

I was thinking about the empty cases for 7, 8, 9.  Why are they empty?

> --- libmpcodecs/ad_ffmpeg.c	(revision 31984)
> +++ libmpcodecs/ad_ffmpeg.c	(working copy)
> @@ -99,6 +99,18 @@
> +      
> +      switch(verbose){
> +      case MSGL_FATAL: av_log_set_level(AV_LOG_FATAL); break;
> +      case MSGL_ERR:   av_log_set_level(AV_LOG_ERROR); break;
> +      case MSGL_WARN:  av_log_set_level(AV_LOG_WARNING); break;
> +      case MSGL_INFO:  av_log_set_level(AV_LOG_INFO); break;
> +      case MSGL_V:     av_log_set_level(AV_LOG_DEBUG); break;

Align the break statements for even better readability.

Diego


More information about the MPlayer-dev-eng mailing list