Commit 40f97350 authored by Antoine Cellerier's avatar Antoine Cellerier

Print more debug messages from ffmpeg when using the mux module in VLC.

parent 86843e19
......@@ -365,9 +365,9 @@ static void CloseDecoder( vlc_object_t *p_this )
}
/*****************************************************************************
* local Functions
*
*****************************************************************************/
static void LibavcodecCallback( void *p_opaque, int i_level,
void E_(LibavcodecCallback)( void *p_opaque, int i_level,
const char *psz_format, va_list va )
{
int i_vlc_level;
......@@ -416,7 +416,7 @@ static void LibavcodecCallback( void *p_opaque, int i_level,
+ 18 + 5 );
snprintf( psz_new_format, strlen(psz_format) + strlen(psz_item_name)
+ 18 + 5, "%s (%s@%p)", psz_format, p_avc->item_name(p_opaque), p_opaque );
msg_GenericVa( p_this, MSG_QUEUE_NORMAL,i_vlc_level,
msg_GenericVa( p_this, MSG_QUEUE_NORMAL, i_vlc_level,
MODULE_STRING, psz_new_format, va );
free( psz_new_format );
}
......@@ -434,7 +434,7 @@ void E_(InitLibavcodec)( vlc_object_t *p_object )
{
avcodec_init();
avcodec_register_all();
av_log_set_callback( LibavcodecCallback );
av_log_set_callback( E_(LibavcodecCallback) );
b_ffmpeginit = 1;
msg_Dbg( p_object, "libavcodec initialized (interface %d )",
......
......@@ -29,6 +29,8 @@ struct AVCodecContext;
struct AVCodec;
void E_(InitLibavcodec)( vlc_object_t * );
void E_(LibavcodecCallback)( void *p_opaque, int i_level,
const char *psz_format, va_list va );
int E_(GetFfmpegCodec) ( vlc_fourcc_t, int *, int *, const char ** );
int E_(GetVlcFourcc) ( int, int *, vlc_fourcc_t *, const char ** );
int E_(GetFfmpegChroma)( vlc_fourcc_t );
......
......@@ -91,6 +91,7 @@ int E_(OpenMux)( vlc_object_t *p_this )
/* Should we call it only once ? */
av_register_all();
av_log_set_callback( E_(LibavcodecCallback) );
config_ChainParse( p_mux, "ffmpeg-", ppsz_mux_options, p_mux->p_cfg );
......@@ -215,6 +216,9 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
}
codec = stream->codec;
/* This is used by LibavcodecCallback (ffmpeg.c) to print messages */
codec->opaque = (void*)p_mux;
switch( p_input->p_fmt->i_cat )
{
case AUDIO_ES:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment