/*****************************************************************************
* Preamble
*****************************************************************************/
+#define _GNU_SOURCE
#include <stdlib.h>
#include <vlc/vlc.h>
free( psz_name );
/* Set up p_access */
- p_access->pf_read = NULL;
- p_access->pf_block = Block;
- p_access->pf_control = Control;
- p_access->pf_seek = Seek;
- p_access->info.i_update = 0;
- p_access->info.i_size = 0;
- p_access->info.i_pos = 0;
- p_access->info.b_eof = VLC_FALSE;
- p_access->info.i_title = 0;
- p_access->info.i_seekpoint = 0;
- p_access->p_sys = p_sys = malloc( sizeof( access_sys_t ) );
- memset( p_sys, 0, sizeof( access_sys_t ) );
+ STANDARD_BLOCK_ACCESS_INIT
p_sys->vcddev = vcddev;
/* We only do separate items if the whole disc is requested -
if( p_sys->i_track < 0 && i_mrl_tracknum <= 0 )
{
- p_playlist = (playlist_t *) vlc_object_find( p_access,
- VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
- if( !p_playlist ) return VLC_EGENERIC;
-
+ p_playlist = pl_Yield( p_access );
if( p_playlist->status.p_item->p_input ==
((input_thread_t *)p_access->p_parent)->input.p_item )
p_item = p_playlist->status.p_item;
{
input_item_t *p_current = ( (input_thread_t*)p_access->p_parent)->
input.p_item;
- p_item = playlist_LockItemGetByInput( p_playlist, p_current );
+ p_item = playlist_ItemGetByInput( p_playlist, p_current, VLC_FALSE );
if( !p_item )
{
return VLC_EGENERIC;
}
- p_item_in_category = playlist_LockItemToNode( p_playlist, p_parent );
+ p_item_in_category = playlist_ItemToNode( p_playlist, p_parent, VLC_FALSE );
psz_name = strdup( "Audio CD" );
vlc_mutex_lock( &p_playlist->object_lock );
playlist_ItemSetName( p_parent, psz_name );
p_input_item = input_ItemNewWithType( VLC_OBJECT( p_playlist ),
psz_uri, psz_name, 0, NULL, -1,
ITEM_TYPE_DISC );
- vlc_input_item_AddOption( p_input_item, psz_first );
- vlc_input_item_AddOption( p_input_item, psz_last );
- vlc_input_item_AddOption( p_input_item, psz_opt );
+ input_ItemAddOption( p_input_item, psz_first );
+ input_ItemAddOption( p_input_item, psz_last );
+ input_ItemAddOption( p_input_item, psz_opt );
#ifdef HAVE_LIBCDDB
/* If we have CDDB info, change the name */
{
if( cddb_track_get_title( t ) != NULL )
{
- vlc_input_item_AddInfo( p_input_item, _(VLC_META_INFO_CAT),
+ input_ItemAddInfo( p_input_item, _(VLC_META_INFO_CAT),
_(VLC_META_TITLE),
cddb_track_get_title( t ) );
if( p_input_item->psz_name )
psz_result = cddb_track_get_artist( t );
if( psz_result )
{
- vlc_input_item_AddInfo( p_input_item, _(VLC_META_INFO_CAT),
+ input_ItemAddInfo( p_input_item, _(VLC_META_INFO_CAT),
_(VLC_META_ARTIST), psz_result );
}
}
}
#endif
- playlist_AddWhereverNeeded( p_playlist, p_input_item, p_parent,
- p_item_in_category, VLC_FALSE, PLAYLIST_APPEND );
+ playlist_BothAddInput( p_playlist, p_input_item, p_item_in_category,
+ PLAYLIST_APPEND, PLAYLIST_END, NULL, NULL );
free( psz_uri ); free( psz_opt ); free( psz_name );
free( psz_first ); free( psz_last );
}