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 ()
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 ()
*****************************************************************************/
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 )
{
*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:
default:
msg_Warn( p_access, "unimplemented query in control" );
return VLC_EGENERIC;
-
}
return VLC_SUCCESS;
}
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 */