[Ffmpeg-devel] [PATCH] fix av_log_set_level undefined

Limin Wang lance.lmwang
Wed Feb 7 11:11:40 CET 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

* Luca Abeni <lucabe72 at email.it> [2007-02-07 10:55:50 +0100]:

> Hi Guillaume,
> 
> On Wed, 2007-02-07 at 10:32 +0100, Guillaume POIRIER wrote:
> [...]
> > > I think av_log_get/set_level is useful function and
> > > shouldn't depend on LIBAVUTIL_VERSION_INT version.
> > > The attached patch try to fix compile failed after
> > > LIBAVUTIL_VERSION_INT increased.
> > 
> > I confirm that this patch fixes compilation failure.
> > 
> > Is it good to go Michael?
> I am not Michael, but I seem to remember the discussion that originated
> the removal of av_log_{get,set}_level().
> I think Michael wanted to remove such functions by exporting
> av_log_level and directly accessing it.
> 
> If my understanding is correct, the attached patch might be a better
> solution.

I prefer to using av_log_{get,set}_level() instead of using global variable.
If want to keep them, then av_log_level should be defined as static.
  

Thanks,
Limin
 
> 
> 			Thanks,
> 				Luca
> -- 
> _____________________________________________________________________________
> Copy this in your signature, if you think it is important:
>                                N O    W A R ! ! !

> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 7867)
> +++ ffmpeg.c	(working copy)
> @@ -2084,7 +2084,7 @@
>  static void opt_verbose(const char *arg)
>  {
>      verbose = atoi(arg);
> -    av_log_set_level(atoi(arg));
> +    av_log_level = atoi(arg);
>  }
>  
>  static void opt_frame_rate(const char *arg)
> @@ -3676,7 +3676,7 @@
>  #endif
>  
>      if(avctx_opts->debug)
> -        av_log_set_level(AV_LOG_DEBUG);
> +        av_log_level = AV_LOG_DEBUG;
>      return 0;
>  }
>  
> Index: libavcodec/utils.c
> ===================================================================
> --- libavcodec/utils.c	(revision 7867)
> +++ libavcodec/utils.c	(working copy)
> @@ -1102,7 +1102,7 @@
>              snprintf(buf + strlen(buf), buf_size - strlen(buf),
>                       ", %dx%d",
>                       enc->width, enc->height);
> -            if(av_log_get_level() >= AV_LOG_DEBUG){
> +            if(av_log_level >= AV_LOG_DEBUG){
>                  int g= ff_gcd(enc->time_base.num, enc->time_base.den);
>                  snprintf(buf + strlen(buf), buf_size - strlen(buf),
>                       ", %d/%d",
> Index: ffplay.c
> ===================================================================
> --- ffplay.c	(revision 7867)
> +++ ffplay.c	(working copy)
> @@ -2385,7 +2385,7 @@
>  
>  static void opt_debug(const char *arg)
>  {
> -    av_log_set_level(99);
> +    av_log_level = 99;
>      debug = atoi(arg);
>  }
>  

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBRcml3Eztbf7dKiuoAQLMNQf7BF5XoUo7oA/71AvToTOFCkAz9X1o/3KX
z8sCMBjeWsvgImbjldRpB5vTY8LM5hezHOHjyxL1J5P1T8iXhhoWynrDT0tE96Tb
exscBGyxdBc5kRFF3LC6yHIhh9wN3QMcpw41yBYgLpweORHbq7sjmB4orxJhShfY
y49+WjtQ84wwTG7KYUC/Yj7D5WHuPkFUrhGxjaF7jppwB8AD3hD1cvmO5/yIVhSN
CuIrf00394w0jIjG2E743ywwuE5buPi048nhDmxFXnHraU+sGjZiNFbcYIyfgK/7
YLmgyAxsfJx/JUlHq10pKlRGvVioYGEGL0jlfs+7PaoX4nziNoXkXw==
=LI3S
-----END PGP SIGNATURE-----




More information about the ffmpeg-devel mailing list