Signed-off-by: Rémi Duraffort <ivoire@videolan.org>
25 files changed:
#ifdef HAVE_LIBCDDB
#define free_and_dup(var, val) \
#ifdef HAVE_LIBCDDB
#define free_and_dup(var, val) \
- if (var) free(var); \
- if (val) var=strdup(val);
+ free( var ); \
+ if (val) var = strdup( val );
/* Saves CDDB information about CD-DA via libcddb. */
/* Saves CDDB information about CD-DA via libcddb. */
free( p_sys );
return VLC_EGENERIC;
}
free( p_sys );
return VLC_EGENERIC;
}
- if (p_sys->plane) free(p_sys->plane);
p_sys->plane = malloc (p_dec->fmt_in.video.i_width*p_dec->fmt_in.video.i_height*3/2 + 1024 );
if (NULL == p_sys->plane)
{
p_sys->plane = malloc (p_dec->fmt_in.video.i_width*p_dec->fmt_in.video.i_height*3/2 + 1024 );
if (NULL == p_sys->plane)
{
#endif
p_sys->rv_handle=NULL;
#endif
p_sys->rv_handle=NULL;
- if (p_sys->plane)
- {
- free(p_sys->plane);
- p_sys->plane = NULL;
- }
+ free( p_sys->plane );
+ p_sys->plane = NULL;
msg_Dbg( p_dec, "FreeLibrary ok." );
#ifdef LOADER
msg_Dbg( p_dec, "FreeLibrary ok." );
#ifdef LOADER
/* worst case */
size_t i_buffer = BLOCK_MAX_SIZE * MAX_CHANNELS * p_sys->wmadec.nb_frames;
/* worst case */
size_t i_buffer = BLOCK_MAX_SIZE * MAX_CHANNELS * p_sys->wmadec.nb_frames;
- if( p_sys->p_output )
- free( p_sys->p_output );
+ free( p_sys->p_output );
p_sys->p_output = malloc(i_buffer * sizeof(int32_t) );
p_sys->p_samples = (int8_t*)p_sys->p_output;
p_sys->p_output = malloc(i_buffer * sizeof(int32_t) );
p_sys->p_samples = (int8_t*)p_sys->p_output;
if( !b_error )
var_Set( p_object, psz_variable, val );
if( !b_error )
var_Set( p_object, psz_variable, val );
- if( psz_value != NULL )
- free( psz_value );
}
else
msg_Warn( p_intf, "vlc_var_set called without an object" );
}
else
msg_Warn( p_intf, "vlc_var_set called without an object" );
}
i_result = config_SaveConfigFile( p_intf, psz_module );
}
i_result = config_SaveConfigFile( p_intf, psz_module );
- if( psz_module != NULL )
- free( psz_module );
SSPushN( st, i_result );
}
else if( !strcmp( s, "vlc_config_reset" ) )
SSPushN( st, i_result );
}
else if( !strcmp( s, "vlc_config_reset" ) )
{
KaxTrackLanguage &lang = *(KaxTrackLanguage*)l;
{
KaxTrackLanguage &lang = *(KaxTrackLanguage*)l;
- if ( tk->fmt.psz_language != NULL )
- free( tk->fmt.psz_language );
+ free( tk->fmt.psz_language );
tk->fmt.psz_language = strdup( string( lang ).c_str() );
msg_Dbg( &sys.demuxer,
"| | | + Track Language=`%s'", tk->fmt.psz_language );
tk->fmt.psz_language = strdup( string( lang ).c_str() );
msg_Dbg( &sys.demuxer,
"| | | + Track Language=`%s'", tk->fmt.psz_language );
void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
{
/* Delete old popup if there is one */
void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
{
/* Delete old popup if there is one */
- if( p_intf->p_sys->p_popup_menu )
- delete p_intf->p_sys->p_popup_menu;
+ delete p_intf->p_sys->p_popup_menu;
void AsyncQueue::destroy( intf_thread_t *pIntf )
{
void AsyncQueue::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_queue )
- {
- delete pIntf->p_sys->p_queue;
- pIntf->p_sys->p_queue = NULL;
- }
+ delete pIntf->p_sys->p_queue;
+ pIntf->p_sys->p_queue = NULL;
void MacOSXLoop::destroy( intf_thread_t *pIntf )
{
void MacOSXLoop::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_osLoop )
- {
- delete pIntf->p_sys->p_osLoop;
- pIntf->p_sys->p_osLoop = NULL;
- }
+ delete pIntf->p_sys->p_osLoop;
+ pIntf->p_sys->p_osLoop = NULL;
void Interpreter::destroy( intf_thread_t *pIntf )
{
void Interpreter::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_interpreter )
- {
- delete pIntf->p_sys->p_interpreter;
- pIntf->p_sys->p_interpreter = NULL;
- }
+ delete pIntf->p_sys->p_interpreter;
+ pIntf->p_sys->p_interpreter = NULL;
void Dialogs::destroy( intf_thread_t *pIntf )
{
void Dialogs::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_dialogs )
- {
- delete pIntf->p_sys->p_dialogs;
- pIntf->p_sys->p_dialogs = NULL;
- }
+ delete pIntf->p_sys->p_dialogs;
+ pIntf->p_sys->p_dialogs = NULL;
void Logger::destroy( intf_thread_t *pIntf )
{
void Logger::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_logger )
- {
- delete pIntf->p_sys->p_logger;
- pIntf->p_sys->p_logger = NULL;
- }
+ delete pIntf->p_sys->p_logger;
+ pIntf->p_sys->p_logger = NULL;
void OSFactory::destroy( intf_thread_t *pIntf )
{
void OSFactory::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_osFactory )
- {
- delete pIntf->p_sys->p_osFactory;
- pIntf->p_sys->p_osFactory = NULL;
- }
+ delete pIntf->p_sys->p_osFactory;
+ pIntf->p_sys->p_osFactory = NULL;
void ThemeRepository::destroy( intf_thread_t *pIntf )
{
void ThemeRepository::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_repository )
- {
- delete pIntf->p_sys->p_repository;
- pIntf->p_sys->p_repository = NULL;
- }
+ delete pIntf->p_sys->p_repository;
+ pIntf->p_sys->p_repository = NULL;
void VarManager::destroy( intf_thread_t *pIntf )
{
void VarManager::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_varManager )
- {
- delete pIntf->p_sys->p_varManager;
- pIntf->p_sys->p_varManager = NULL;
- }
+ delete pIntf->p_sys->p_varManager;
+ pIntf->p_sys->p_varManager = NULL;
void VlcProc::destroy( intf_thread_t *pIntf )
{
void VlcProc::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_vlcProc )
- {
- delete pIntf->p_sys->p_vlcProc;
- pIntf->p_sys->p_vlcProc = NULL;
- }
+ delete pIntf->p_sys->p_vlcProc;
+ pIntf->p_sys->p_vlcProc = NULL;
void VoutManager::destroy( intf_thread_t *pIntf )
{
void VoutManager::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_voutManager )
- {
- delete pIntf->p_sys->p_voutManager;
- pIntf->p_sys->p_voutManager = NULL;
- }
+ delete pIntf->p_sys->p_voutManager;
+ pIntf->p_sys->p_voutManager = NULL;
void Win32Loop::destroy( intf_thread_t *pIntf )
{
void Win32Loop::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_osLoop )
- {
- delete pIntf->p_sys->p_osLoop;
- pIntf->p_sys->p_osLoop = NULL;
- }
+ delete pIntf->p_sys->p_osLoop;
+ pIntf->p_sys->p_osLoop = NULL;
void X11Loop::destroy( intf_thread_t *pIntf )
{
void X11Loop::destroy( intf_thread_t *pIntf )
{
- if( pIntf->p_sys->p_osLoop )
- {
- delete pIntf->p_sys->p_osLoop;
- pIntf->p_sys->p_osLoop = NULL;
- }
+ delete pIntf->p_sys->p_osLoop;
+ pIntf->p_sys->p_osLoop = NULL;
* - required for ogg muxing
* - useful for error checking
* - it isn't allowed to change until an eos */
* - required for ogg muxing
* - useful for error checking
* - it isn't allowed to change until an eos */
- if( p_es->p_extra )
- free( p_es->p_extra );
p_es->p_extra = calloc( 1, p_block->i_buffer + 13 );
if( !p_es->p_extra )
{
p_es->p_extra = calloc( 1, p_block->i_buffer + 13 );
if( !p_es->p_extra )
{
}
CAtmoConfig::~CAtmoConfig() {
}
CAtmoConfig::~CAtmoConfig() {
- // and finally cleanup...
- clearAllChannelMappings();
+ // and finally cleanup...
+ clearAllChannelMappings();
- if(m_devicename)
- free(m_devicename);
}
void CAtmoConfig::SetChannelAssignment(int index, tChannelAssignment *ta) {
}
void CAtmoConfig::SetChannelAssignment(int index, tChannelAssignment *ta) {
- if(m_ChannelAssignments[index]!=NULL)
- delete m_ChannelAssignments[index];
- m_ChannelAssignments[index] = ta;
+ delete m_ChannelAssignments[index];
+ m_ChannelAssignments[index] = ta;
}
CAtmoZoneDefinition *CAtmoConfig::getZoneDefinition(int zoneIndex) {
}
CAtmoZoneDefinition *CAtmoConfig::getZoneDefinition(int zoneIndex) {
CAtmoExternalCaptureInput::~CAtmoExternalCaptureInput(void)
{
CAtmoExternalCaptureInput::~CAtmoExternalCaptureInput(void)
{
- /* if there is still an unprocessed bufferpicture do kill it */
- if(m_pCurrentFramePixels != NULL)
- free(m_pCurrentFramePixels);
+ /* if there is still an unprocessed bufferpicture do kill it */
+ free( m_pCurrentFramePixels );
#if defined(_ATMO_VLC_PLUGIN_)
vlc_cond_destroy( &m_WakeupCond );
#if defined(_ATMO_VLC_PLUGIN_)
vlc_cond_destroy( &m_WakeupCond );
we need a buffer where the image is stored (only for transfer
to the processing thread)
*/
we need a buffer where the image is stored (only for transfer
to the processing thread)
*/
- if(p_sys->p_atmo_transfer_buffer)
- free(p_sys->p_atmo_transfer_buffer);
+ free( p_sys->p_atmo_transfer_buffer );
p_sys->p_atmo_transfer_buffer = (uint8_t *)malloc(bytePerPixel *
width * height);
p_sys->p_atmo_transfer_buffer = (uint8_t *)malloc(bytePerPixel *
width * height);
if( p_filter->p_sys->p_storage )
cvReleaseMemStorage( &p_filter->p_sys->p_storage );
if( p_filter->p_sys->p_storage )
cvReleaseMemStorage( &p_filter->p_sys->p_storage );
- if (NULL != p_filter->p_sys->event_info.p_region)
- free(p_filter->p_sys->event_info.p_region);
-
+ free( p_filter->p_sys->event_info.p_region );
free( p_sys );
var_Destroy( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE);
free( p_sys );
var_Destroy( p_filter->p_libvlc, VIDEO_FILTER_EVENT_VARIABLE);
if (faces && (faces->total > 0))
{
//msg_Dbg( p_filter, "Found %d face(s)", faces->total );
if (faces && (faces->total > 0))
{
//msg_Dbg( p_filter, "Found %d face(s)", faces->total );
- if (NULL != p_filter->p_sys->event_info.p_region)
- {
- free(p_filter->p_sys->event_info.p_region);
- p_filter->p_sys->event_info.p_region = NULL;
- }
+ free( p_filter->p_sys->event_info.p_region );
+ p_filter->p_sys->event_info.p_region = NULL;
if( NULL == ( p_filter->p_sys->event_info.p_region =
(video_filter_region_info_t *)malloc(faces->total*sizeof(video_filter_region_info_t))))
{
if( NULL == ( p_filter->p_sys->event_info.p_region =
(video_filter_region_info_t *)malloc(faces->total*sizeof(video_filter_region_info_t))))
{
module_unneed( p_vout, p_vout->p_sys->p_qte_main );
#endif
module_unneed( p_vout, p_vout->p_sys->p_qte_main );
#endif
- if( p_vout->p_sys )
- {
- free( p_vout->p_sys );
- p_vout->p_sys = NULL;
- }
+ free( p_vout->p_sys );
+ p_vout->p_sys = NULL;
}
/*****************************************************************************
}
/*****************************************************************************
- if( p_vout->p_sys->xvmc_cap )
- free( p_vout->p_sys->xvmc_cap );
+ free( p_vout->p_sys->xvmc_cap );
p_vout->p_sys->xvmc_cap = NULL;
msg_Err( p_vout, "use of direct XvMC context on a remote display failed"
" falling back to XV." );
p_vout->p_sys->xvmc_cap = NULL;
msg_Err( p_vout, "use of direct XvMC context on a remote display failed"
" falling back to XV." );
}
msg_Dbg( p_vout, "freeing up XvMC surfaces and subpictures" );
}
msg_Dbg( p_vout, "freeing up XvMC surfaces and subpictures" );
- if( p_vout->p_sys->xvmc_palette )
- free( p_vout->p_sys->xvmc_palette );
+ free( p_vout->p_sys->xvmc_palette );
dispose_xx44_palette( &p_vout->p_sys->palette );
xxmc_xvmc_destroy_subpictures( p_vout );
xxmc_xvmc_destroy_surfaces( p_vout );
dispose_xx44_palette( &p_vout->p_sys->palette );
xxmc_xvmc_destroy_subpictures( p_vout );
xxmc_xvmc_destroy_surfaces( p_vout );