* cdda.c : CD digital audio input module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: cdda.c,v 1.1 2003/05/17 20:30:31 gbazin Exp $
+ * $Id: cdda.c,v 1.4 2003/05/22 12:00:56 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
vlc_module_begin();
set_description( _("CD Audio input") );
add_integer( "cdda-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE );
- set_capability( "access", 80 );
+ set_capability( "access", 70 );
set_callbacks( CDDAOpen, CDDAClose );
add_shortcut( "cdda" );
int i_title = 1;
vcddev_t *vcddev;
-#ifdef WIN32
- /* On Win32 we want the CDDA access plugin to be explicitly requested,
- * we end up with lots of problems otherwise */
- if( !p_input->psz_access || !*p_input->psz_access ) return( -1 );
-#endif
-
/* parse the options passed in command line : */
psz_orig = psz_parser = psz_source = strdup( p_input->psz_name );
p_input->pf_set_area = CDDASetArea;
p_input->pf_set_program = CDDASetProgram;
+ /* Update default_pts to a suitable value for cdda access */
+ p_input->i_pts_delay = config_GetInt( p_input, "cdda-caching" ) * 1000;
+
return 0;
}
i_blocks = i_len / CDDA_DATA_SIZE;
- for ( i_index = 0; i_index < i_blocks; i_index++ )
+ if ( ioctl_ReadSectors( VLC_OBJECT(p_input), p_cdda->vcddev,
+ p_cdda->i_sector, p_buffer, i_blocks, CDDA_TYPE ) < 0 )
{
- if ( ioctl_ReadSector( VLC_OBJECT(p_input), p_cdda->vcddev,
- p_cdda->i_sector, p_buffer + i_index * CDDA_DATA_SIZE,
- CDDA_DATA_START, CDDA_DATA_SIZE ) < 0 )
- {
- msg_Err( p_input, "could not read sector %d", p_cdda->i_sector );
- return -1;
- }
+ msg_Err( p_input, "could not read sector %d", p_cdda->i_sector );
+ return -1;
+ }
+ for ( i_index = 0; i_index < i_blocks; i_index++ )
+ {
p_cdda->i_sector ++;
if ( p_cdda->i_sector == p_cdda->p_sectors[p_cdda->i_track + 1] )
{