]> git.sesse.net Git - vlc/blobdiff - modules/access/cdda.c
Used uint64_t for access_t::info.i_size/i_pos and access_t::pf_seek().
[vlc] / modules / access / cdda.c
index 8466c7449e54bb165a66721009a06b6ad1ed1afa..75b8cc0d2f32d4645958ff84f4873ad1f42cfc40 100644 (file)
@@ -35,6 +35,7 @@
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
+#include <assert.h>
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
@@ -119,7 +120,7 @@ struct access_sys_t
 };
 
 static block_t *Block( access_t * );
-static int      Seek( access_t *, int64_t );
+static int      Seek( access_t *, uint64_t );
 static int      Control( access_t *, int, va_list );
 
 static int GetTracks( access_t *p_access, input_item_t *p_current );
@@ -321,12 +322,13 @@ static block_t *Block( access_t *p_access )
 /****************************************************************************
  * Seek
  ****************************************************************************/
-static int Seek( access_t *p_access, int64_t i_pos )
+static int Seek( access_t *p_access, uint64_t i_pos )
 {
     access_sys_t *p_sys = p_access->p_sys;
 
     /* Next sector to read */
     p_sys->i_sector = p_sys->i_first_sector + i_pos / CDDA_DATA_SIZE;
+    assert( p_sys->i_sector >= 0 );
     p_access->info.i_pos = i_pos;
 
     return VLC_SUCCESS;
@@ -612,11 +614,14 @@ static cddb_disc_t *GetCDDBInfo( access_t *p_access, int i_titles, int *p_sector
     }
 
     /* */
-    char *psz_tmp = config_GetPsz( p_access, "cddb-server" );
-    cddb_set_server_name( p_cddb, psz_tmp );
-    free( psz_tmp );
+    char *psz_tmp = var_InheritString( p_access, "cddb-server" );
+    if( psz_tmp )
+    {
+        cddb_set_server_name( p_cddb, psz_tmp );
+        free( psz_tmp );
+    }
 
-    cddb_set_server_port( p_cddb, config_GetInt( p_access, "cddb-port" ) );
+    cddb_set_server_port( p_cddb, var_InheritInteger( p_access, "cddb-port" ) );
 
     cddb_set_email_address( p_cddb, "vlc@videolan.org" );
 
@@ -624,7 +629,7 @@ static cddb_disc_t *GetCDDBInfo( access_t *p_access, int i_titles, int *p_sector
     cddb_cache_disable( p_cddb );
 
 //    cddb_cache_set_dir( p_cddb,
-//                     config_GetPsz( p_access,
+//                     var_InheritString( p_access,
 //                                    MODULE_STRING "-cddb-cachedir") );
 
     cddb_set_timeout( p_cddb, 10 );