* access.c: access capabilities for dvdplay plugin.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: access.c,v 1.9 2002/12/31 01:54:35 massiot Exp $
+ * $Id: access.c,v 1.10 2003/01/28 15:05:52 massiot Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
/* Open libdvdplay */
p_dvd->vmg = dvdplay_open( psz_source, pf_vmg_callback, (void*)p_input );
- /* free allocated strings */
- free( psz_source );
-
if( p_dvd->vmg == NULL )
{
msg_Err( p_input, "cannot open %s", psz_source );
+ free( psz_source );
free( p_dvd );
return -1;
}
+ /* free allocated strings */
+ free( psz_source );
+
p_dvd->p_intf = NULL;
p_dvd->i_still_time = 0;
* tools.c: tools for dvd plugin.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: tools.c,v 1.3 2002/10/28 16:26:44 sam Exp $
+ * $Id: tools.c,v 1.4 2003/01/28 15:05:52 massiot Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
p_dvd = (dvd_data_t*)(p_input->p_access_data);
- psz_parser = psz_source = strdup( p_input->psz_name );
- if( !psz_parser )
+ psz_source = strdup( p_input->psz_name );
+ if( psz_source == NULL )
{
return NULL;
}
- while( *psz_parser && *psz_parser != '@' )
- {
- psz_parser++;
- }
-
*i_title = 0;
*i_chapter = 1;
*i_angle = 1;
- if( *psz_parser == '@' )
+ /* Start with the end, because you could have :
+ * dvdplay:/Volumes/my@toto/VIDEO_TS@1,1
+ * (yes, this is kludgy). */
+ for ( psz_parser = psz_source + strlen(psz_source) - 1;
+ psz_parser >= psz_source && *psz_parser != '@';
+ psz_parser-- );
+
+ if( psz_parser >= psz_source && *psz_parser == '@' )
{
/* Found options */
*psz_parser = '\0';
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: input.c,v 1.14 2003/01/23 15:50:15 sam Exp $
+ * $Id: input.c,v 1.15 2003/01/28 15:05:52 massiot Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
unsigned int i_angle = 1;
unsigned int i;
- psz_parser = psz_source = strdup( p_input->psz_name );
- if( !psz_source )
+ psz_source = strdup( p_input->psz_name );
+ if( psz_source == NULL )
{
return VLC_ENOMEM;
}
p_input->pf_set_area = DvdReadSetArea;
p_input->pf_set_program = DvdReadSetProgram;
- while( *psz_parser && *psz_parser != '@' )
- {
- psz_parser++;
- }
+ /* Start with the end, because you could have :
+ * dvdread:/Volumes/my@toto/VIDEO_TS@1,1
+ * (yes, this is kludgy). */
+ for ( psz_parser = psz_source + strlen(psz_source) - 1;
+ psz_parser >= psz_source && *psz_parser != '@';
+ psz_parser-- );
- if( *psz_parser == '@' )
+ if( psz_parser >= psz_source && *psz_parser == '@' )
{
/* Found options */
*psz_parser = '\0';