common.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*****************************************************************************
  2. * common.c: misc common functions
  3. *****************************************************************************
  4. * Copyright (C) 2003-2018 x264 project
  5. *
  6. * Authors: Loren Merritt <lorenm@u.washington.edu>
  7. * Laurent Aimar <fenrir@via.ecp.fr>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
  22. *
  23. * This program is also available under a commercial proprietary license.
  24. * For more information, contact us at licensing@x264.com.
  25. *****************************************************************************/
  26. #include "common.h"
  27. /****************************************************************************
  28. * x264_log:
  29. ****************************************************************************/
  30. void x264_log( x264_t *h, int i_level, const char *psz_fmt, ... )
  31. {
  32. if( !h || i_level <= h->param.i_log_level )
  33. {
  34. va_list arg;
  35. va_start( arg, psz_fmt );
  36. if( !h )
  37. x264_log_default( NULL, i_level, psz_fmt, arg );
  38. else
  39. h->param.pf_log( h->param.p_log_private, i_level, psz_fmt, arg );
  40. va_end( arg );
  41. }
  42. }