]> git.sesse.net Git - vlc/blobdiff - modules/access/cdda.c
Trailing ;
[vlc] / modules / access / cdda.c
index a26c844848a0aef58abdf622f27354e38c28d4fc..6748651883f8ecde04c72c7a13534430f6c6c53d 100644 (file)
@@ -75,7 +75,7 @@ vlc_module_begin ()
 
     add_usage_hint( N_("[cdda:][device][@[track]]") )
     add_integer( "cdda-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT,
-                 CACHING_LONGTEXT, true );
+                 CACHING_LONGTEXT, true )
 
     add_integer( "cdda-track", -1 , NULL, NULL, NULL, true )
         change_internal ()
@@ -86,10 +86,10 @@ vlc_module_begin ()
 
     add_string( "cddb-server", "freedb.freedb.org", NULL,
                 N_( "CDDB Server" ), N_( "Address of the CDDB server to use." ),
-                true );
+                true )
     add_integer( "cddb-port", 8880, NULL,
                 N_( "CDDB port" ), N_( "CDDB Server port to use." ),
-                true );
+                true )
     add_shortcut( "cdda" )
     add_shortcut( "cddasimple" )
 vlc_module_end ()
@@ -341,9 +341,8 @@ static int Seek( access_t *p_access, int64_t i_pos )
  *****************************************************************************/
 static int Control( access_t *p_access, int i_query, va_list args )
 {
-    bool   *pb_bool;
-    int          *pi_int;
-    int64_t      *pi_64;
+    bool    *pb_bool;
+    int64_t *pi_64;
 
     switch( i_query )
     {
@@ -355,14 +354,9 @@ static int Control( access_t *p_access, int i_query, va_list args )
             *pb_bool = true;
             break;
 
-        case ACCESS_GET_MTU:
-            pi_int = (int*)va_arg( args, int * );
-            *pi_int = CDDA_DATA_ONCE;
-            break;
-
         case ACCESS_GET_PTS_DELAY:
             pi_64 = (int64_t*)va_arg( args, int64_t * );
-            *pi_64 = var_GetInteger( p_access, "cdda-caching" ) * 1000;
+            *pi_64 = var_GetInteger( p_access, "cdda-caching" ) * INT64_C(1000);
             break;
 
         case ACCESS_SET_PAUSE_STATE:
@@ -379,7 +373,6 @@ static int Control( access_t *p_access, int i_query, va_list args )
         default:
             msg_Warn( p_access, "unimplemented query in control" );
             return VLC_EGENERIC;
-
     }
     return VLC_SUCCESS;
 }
@@ -432,20 +425,19 @@ static int GetTracks( access_t *p_access, input_item_t *p_current )
             psz_last = NULL;
 
         /* Define a "default name" */
-        if( asprintf( &psz_name, _("Audio CD - Track %i"), (i+1) ) == -1 )
+        if( asprintf( &psz_name, _("Audio CD - Track %02i"), (i+1) ) == -1 )
             psz_name = NULL;
 
         /* Create playlist items */
+        const mtime_t i_duration = (int64_t)( p_sys->p_sectors[i+1] - p_sys->p_sectors[i] ) *
+                                   CDDA_DATA_SIZE * 1000000 / 44100 / 2 / 2;
         p_input_item = input_item_NewWithType( VLC_OBJECT( p_access ),
-                                              psz_uri, psz_name, 0, NULL, -1,
+                                              psz_uri, psz_name, 0, NULL, 0, i_duration,
                                               ITEM_TYPE_DISC );
         input_item_CopyOptions( p_current, p_input_item );
-        input_item_AddOption( p_input_item, psz_first );
-        input_item_AddOption( p_input_item, psz_last );
-        input_item_AddOption( p_input_item, psz_opt );
-        const mtime_t i_duration = (int64_t)( p_sys->p_sectors[i+1] - p_sys->p_sectors[i] ) *
-                                   CDDA_DATA_SIZE * 1000000 / 44100 / 2 / 2;
-        input_item_SetDuration( p_input_item, i_duration );
+        input_item_AddOption( p_input_item, psz_first, VLC_INPUT_OPTION_TRUSTED );
+        input_item_AddOption( p_input_item, psz_last, VLC_INPUT_OPTION_TRUSTED );
+        input_item_AddOption( p_input_item, psz_opt, VLC_INPUT_OPTION_TRUSTED );
 
 #ifdef HAVE_LIBCDDB
         /* If we have CDDB info, change the name */