* tools.c: tools for dvd plugin.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: tools.c,v 1.1 2002/08/04 17:23:42 sam Exp $
+ * $Id: tools.c,v 1.2 2002/10/23 21:54:33 gbazin Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
return NULL;
}
psz_source = config_GetPsz( p_input, "dvd" );
+ if( !psz_source ) return NULL;
}
if( stat( psz_source, &stat_info ) == -1 )
{
msg_Err( p_input, "cannot stat() source `%s' (%s)",
psz_source, strerror(errno));
+ free( psz_source );
return NULL;
}
if( !S_ISBLK(stat_info.st_mode) &&
{
msg_Dbg( p_input, "plugin discarded"
" (not a valid source)" );
+ free( psz_source );
return NULL;
}
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: input.c,v 1.4 2002/08/30 22:22:24 massiot Exp $
+ * $Id: input.c,v 1.5 2002/10/23 21:54:33 gbazin Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
int E_(OpenDVD) ( vlc_object_t *p_this )
{
input_thread_t * p_input = (input_thread_t *)p_this;
- char * psz_orig;
char * psz_parser;
char * psz_source;
char * psz_next;
int i_angle = 1;
int i;
- psz_orig = psz_parser = psz_source = strdup( p_input->psz_name );
- if( !psz_orig )
+ psz_parser = psz_source = strdup( p_input->psz_name );
+ if( !psz_source )
{
return( -1 );
}
if( !*psz_source )
{
+ free( psz_source );
if( !p_input->psz_access )
{
- free( psz_orig );
return -1;
}
psz_source = config_GetPsz( p_input, "dvd" );
+ if( !psz_source ) return -1;
}
if( stat( psz_source, &stat_info ) == -1 )
{
msg_Err( p_input, "cannot stat() source `%s' (%s)",
psz_source, strerror(errno));
+ free( psz_source );
return( -1 );
}
if( !S_ISBLK(stat_info.st_mode) &&
!S_ISDIR(stat_info.st_mode) )
{
msg_Warn( p_input, "dvdread module discarded (not a valid source)" );
+ free( psz_source );
return -1;
}
p_dvdread = DVDOpen( psz_source );
/* free allocated strings */
- if( psz_source != psz_orig )
- free( psz_source );
- free( psz_orig );
+ free( psz_source );
if( ! p_dvdread )
{
* demux.c : Raw aac Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: demux.c,v 1.2 2002/08/24 21:35:31 sigmunau Exp $
+ * $Id: demux.c,v 1.3 2002/10/23 21:54:33 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
vlc_mutex_lock( &p_input->stream.stream_lock );
if( input_InitStream( p_input, 0 ) == -1)
{
+ vlc_mutex_unlock( &p_input->stream.stream_lock );
msg_Err( p_input, "cannot init stream" );
return( -1 );
}
if( input_AddProgram( p_input, 0, 0) == NULL )
{
+ vlc_mutex_unlock( &p_input->stream.stream_lock );
msg_Err( p_input, "cannot add program" );
return( -1 );
}
* audio.c : mpeg audio Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: audio.c,v 1.8 2002/08/24 21:35:31 sigmunau Exp $
+ * $Id: audio.c,v 1.9 2002/10/23 21:54:33 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
/* check if it could be a ps stream */
if( !b_forced && CheckPS( p_input ))
{
+ free( p_input->p_demux_data );
return( -1 );
}
else
{
msg_Warn( p_input, "MPEGAudio module discarded (no frame found)" );
+ free( p_input->p_demux_data );
return( -1 );
}
}
if( input_InitStream( p_input, 0 ) == -1)
{
msg_Err( p_input, "cannot init stream" );
+ free( p_input->p_demux_data );
return( -1 );
}
if( input_AddProgram( p_input, 0, 0) == NULL )
{
msg_Err( p_input, "cannot add program" );
+ free( p_input->p_demux_data );
return( -1 );
}
p_input->stream.pp_programs[0]->b_is_ok = 0;
{
vlc_mutex_unlock( &p_input->stream.stream_lock );
msg_Err( p_input, "out of memory" );
+ free( p_input->p_demux_data );
return( -1 );
}
p_demux->p_es->i_stream_id = 1;