Commit dd2aecae authored by Clément Stenac's avatar Clément Stenac

Give a fine name when playing audio CD

parent 1c80c50c
...@@ -189,6 +189,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -189,6 +189,8 @@ static int Open( vlc_object_t *p_this )
p_sys->waveheader.DataChunkID = VLC_FOURCC('d', 'a', 't', 'a'); p_sys->waveheader.DataChunkID = VLC_FOURCC('d', 'a', 't', 'a');
p_sys->waveheader.DataLength = 0; /* we just don't know */ p_sys->waveheader.DataLength = 0; /* we just don't know */
p_access->info.i_update |= INPUT_UPDATE_META;
/* PTS delay */ /* PTS delay */
var_Create( p_access, "cdda-caching", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT ); var_Create( p_access, "cdda-caching", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT );
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -314,6 +316,8 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -314,6 +316,8 @@ static int Control( access_t *p_access, int i_query, va_list args )
int64_t *pi_64; int64_t *pi_64;
input_title_t ***ppp_title; input_title_t ***ppp_title;
int i; int i;
char *psz_title;
vlc_meta_t **pp_meta;
switch( i_query ) switch( i_query )
{ {
...@@ -361,7 +365,7 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -361,7 +365,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
{ {
/* Update info */ /* Update info */
p_access->info.i_update |= p_access->info.i_update |=
INPUT_UPDATE_TITLE|INPUT_UPDATE_SIZE; INPUT_UPDATE_TITLE|INPUT_UPDATE_SIZE|INPUT_UPDATE_META;
p_access->info.i_title = i; p_access->info.i_title = i;
p_access->info.i_size = p_sys->title[i]->i_size; p_access->info.i_size = p_sys->title[i]->i_size;
p_access->info.i_pos = 0; p_access->info.i_pos = 0;
...@@ -371,6 +375,16 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -371,6 +375,16 @@ static int Control( access_t *p_access, int i_query, va_list args )
} }
break; break;
case ACCESS_GET_META:
psz_title = malloc( strlen( _("Audio CD - Track ") ) + 5 );
snprintf( psz_title, 100, _("Audio CD - Track %i" ),
p_access->info.i_title+1 );
pp_meta = (vlc_meta_t**)va_arg( args, vlc_meta_t** );
*pp_meta = vlc_meta_New();
vlc_meta_Add( *pp_meta, VLC_META_TITLE, psz_title );
free( psz_title );
break;
case ACCESS_SET_SEEKPOINT: case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE: case ACCESS_SET_PRIVATE_ID_STATE:
return VLC_EGENERIC; return VLC_EGENERIC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment