Qt: synchronization: subtitles duration parameter
[vlc/vlc-skelet.git] / modules / codec / avcodec / avutil.h
blob48a5222b26eda3891569f84326f5cdc0a01623c3
1 /*****************************************************************************
2 * avutil.h: avutil helper functions
3 *****************************************************************************
4 * Copyright (C) 1999-2008 the VideoLAN team
5 * $Id$
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8 * Gildas Bazin <gbazin@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*****************************************************************************
26 * Export libavutil messages to the VLC message system
27 *****************************************************************************/
28 static inline void LibavutilCallback( void *p_opaque, int i_level,
29 const char *psz_format, va_list va )
31 AVCodecContext *p_avctx = (AVCodecContext *)p_opaque;
32 const AVClass *p_avc;
34 p_avc = p_avctx ? p_avctx->av_class : 0;
36 #define cln p_avc->class_name
37 /* Make sure we can get p_this back */
38 if( !p_avctx || !p_avc || !cln ||
39 cln[0]!='A' || cln[1]!='V' || cln[2]!='C' || cln[3]!='o' ||
40 cln[4]!='d' || cln[5]!='e' || cln[6]!='c' )
42 if( i_level == AV_LOG_ERROR ) vfprintf( stderr, psz_format, va );
43 return;
45 #undef cln
47 switch( i_level )
49 case AV_LOG_DEBUG:
50 case AV_LOG_INFO:
51 /* Print debug messages if they were requested */
52 if( !p_avctx->debug )
53 break;
55 case AV_LOG_ERROR:
56 case AV_LOG_QUIET:
57 vfprintf( stderr, psz_format, va );
58 break;