Commit 4aef7755 authored by Jean-Paul Saman's avatar Jean-Paul Saman

davinci: call CERuntime_Init/Exit() only once for audio and video decoders.

Commit-id: 91ebe760 makes sure that
CERuntime_Init() and CERuntimeExit() are called only once. This commit
uses the wrappers that ensure that for audio and video decoder.
parent 577fb0b7
/*****************************************************************************
* audio.c: audio decoder module using the DaVinci DSP.
*****************************************************************************
* Copyright (C) 2008-2009 M2X BV
* Copyright (C) 2008-2010 M2X BV
* $Id$
*
* Authors: Antoine Cellerier <dionoea at videolan dot org>
......@@ -94,7 +94,7 @@ int OpenAudioDecoder( vlc_object_t *p_this )
if( !GetDavinciDecoder( p_dec->fmt_in.i_codec, &i_cat, &i_xdm,
&psz_codec, &psz_namecodec ) )
{
msg_Dbg( p_dec, "Unsupported codec : %4.4s",(char*)&p_dec->fmt_in.i_codec );
msg_Dbg( p_dec, "Unsupported audio codec : %4.4s",(char*)&p_dec->fmt_in.i_codec );
return VLC_EGENERIC;
}
......@@ -113,7 +113,7 @@ int OpenAudioDecoder( vlc_object_t *p_this )
}
/* Initialize the codec engine */
CERuntime_init();
davinci_RuntimeInit( p_this );
/* Create an engine handle */
p_sys->e = Engine_open( p_sys->psz_ti_engine, NULL /*&Engine_ATTRS*/, &err );
......
......@@ -100,7 +100,7 @@ int OpenVideoDecoder( vlc_object_t *p_this )
}
/* Initialize the codec engine */
CERuntime_init();
davinci_RuntimeInit( p_this );
/* Create an engine handle */
p_sys->e = Engine_open( p_sys->psz_ti_engine, NULL /*&Engine_ATTRS*/, &err );
......@@ -193,7 +193,7 @@ void CloseVideoDecoder( vlc_object_t *p_this )
Engine_close( p_sys->e );
/* Exit the codec engine */
CERuntime_exit();
davinci_RuntimeExit( p_this );
/* Free 'DaVinci compliant' buffers */
davinci_FreeBuffer( &p_sys->in );
......@@ -278,12 +278,14 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
}
}
#ifdef DAVINCI_DEBUG
if( VIDDEC_control( p_sys->d, XDM_GETSTATUS, &dparams, &status )
!= VIDDEC_EOK )
{
msg_Err( p_dec, "Failed to get decoder status" );
goto error;
}
#endif
/* Setup input arguments */
in_args.size = sizeof( in_args );
......
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