]> git.sesse.net Git - vlc/blobdiff - modules/access/cdda.c
* INSTALL.win32: added a small note about running vlc under the msvc debugger.
[vlc] / modules / access / cdda.c
index 688dfcaa15ee86d17280c74717b421ca491fc567..361cb1e2ddc97f5a471854c300788592035ae5c3 100644 (file)
@@ -2,7 +2,7 @@
  * 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>
@@ -91,7 +91,7 @@ static int  CDDADemux        ( input_thread_t * p_input );
 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" );
 
@@ -117,12 +117,6 @@ static int CDDAOpen( vlc_object_t *p_this )
     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 );
 
@@ -240,6 +234,9 @@ static int CDDAOpen( vlc_object_t *p_this )
     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;
 }
 
@@ -277,16 +274,15 @@ static int CDDARead( input_thread_t * p_input, byte_t * p_buffer,
 
     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] )
         {