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. * audio.c: audio decoder module using the DaVinci DSP.
***************************************************************************** *****************************************************************************
* Copyright (C) 2008-2009 M2X BV * Copyright (C) 2008-2010 M2X BV
* $Id$ * $Id$
* *
* Authors: Antoine Cellerier <dionoea at videolan dot org> * Authors: Antoine Cellerier <dionoea at videolan dot org>
...@@ -94,7 +94,7 @@ int OpenAudioDecoder( vlc_object_t *p_this ) ...@@ -94,7 +94,7 @@ int OpenAudioDecoder( vlc_object_t *p_this )
if( !GetDavinciDecoder( p_dec->fmt_in.i_codec, &i_cat, &i_xdm, if( !GetDavinciDecoder( p_dec->fmt_in.i_codec, &i_cat, &i_xdm,
&psz_codec, &psz_namecodec ) ) &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; return VLC_EGENERIC;
} }
...@@ -113,7 +113,7 @@ int OpenAudioDecoder( vlc_object_t *p_this ) ...@@ -113,7 +113,7 @@ int OpenAudioDecoder( vlc_object_t *p_this )
} }
/* Initialize the codec engine */ /* Initialize the codec engine */
CERuntime_init(); davinci_RuntimeInit( p_this );
/* Create an engine handle */ /* Create an engine handle */
p_sys->e = Engine_open( p_sys->psz_ti_engine, NULL /*&Engine_ATTRS*/, &err ); 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 ) ...@@ -100,7 +100,7 @@ int OpenVideoDecoder( vlc_object_t *p_this )
} }
/* Initialize the codec engine */ /* Initialize the codec engine */
CERuntime_init(); davinci_RuntimeInit( p_this );
/* Create an engine handle */ /* Create an engine handle */
p_sys->e = Engine_open( p_sys->psz_ti_engine, NULL /*&Engine_ATTRS*/, &err ); 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 ) ...@@ -193,7 +193,7 @@ void CloseVideoDecoder( vlc_object_t *p_this )
Engine_close( p_sys->e ); Engine_close( p_sys->e );
/* Exit the codec engine */ /* Exit the codec engine */
CERuntime_exit(); davinci_RuntimeExit( p_this );
/* Free 'DaVinci compliant' buffers */ /* Free 'DaVinci compliant' buffers */
davinci_FreeBuffer( &p_sys->in ); davinci_FreeBuffer( &p_sys->in );
...@@ -278,12 +278,14 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block ) ...@@ -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 ) if( VIDDEC_control( p_sys->d, XDM_GETSTATUS, &dparams, &status )
!= VIDDEC_EOK ) != VIDDEC_EOK )
{ {
msg_Err( p_dec, "Failed to get decoder status" ); msg_Err( p_dec, "Failed to get decoder status" );
goto error; goto error;
} }
#endif
/* Setup input arguments */ /* Setup input arguments */
in_args.size = sizeof( in_args ); 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