Commit e7dc693e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove some more unused exceptions

parent 7c912f1e
......@@ -83,12 +83,9 @@ VLC_DEPRECATED_API void
*
* \param p_ml a media list instance
* \param p_mi media instance to add
* \param p_e initialized exception object
*/
VLC_PUBLIC_API void
libvlc_media_list_set_media( libvlc_media_list_t *,
libvlc_media_t *,
libvlc_exception_t *);
libvlc_media_list_set_media( libvlc_media_list_t *p_ml, libvlc_media_t *p_md );
/**
* Get media instance from this media list instance. This action will increase
......@@ -96,12 +93,10 @@ VLC_PUBLIC_API void
* The libvlc_media_list_lock should NOT be held upon entering this function.
*
* \param p_ml a media list instance
* \param p_e initialized exception object
* \return media instance
*/
VLC_PUBLIC_API libvlc_media_t *
libvlc_media_list_media( libvlc_media_list_t *,
libvlc_exception_t *);
libvlc_media_list_media( libvlc_media_list_t *p_ml );
/**
* Add media instance to media list
......@@ -147,12 +142,10 @@ VLC_PUBLIC_API void
* The libvlc_media_list_lock should be held upon entering this function.
*
* \param p_ml a media list instance
* \param p_e initialized exception object
* \return number of items in media list
*/
VLC_PUBLIC_API int
libvlc_media_list_count( libvlc_media_list_t * p_mlist,
libvlc_exception_t * p_e );
libvlc_media_list_count( libvlc_media_list_t *p_ml );
/**
* List media instance in media list at a position
......@@ -173,13 +166,11 @@ VLC_PUBLIC_API libvlc_media_t *
*
* \param p_ml a media list instance
* \param p_mi media list instance
* \param p_e initialized exception object
* \return position of media instance
*/
VLC_PUBLIC_API int
libvlc_media_list_index_of_item( libvlc_media_list_t *,
libvlc_media_t *,
libvlc_exception_t * );
libvlc_media_list_index_of_item( libvlc_media_list_t *p_ml,
libvlc_media_t *p_mi );
/**
* This indicates if this media list is read-only from a user point of view
......@@ -238,12 +229,10 @@ VLC_PUBLIC_API libvlc_media_list_view_t *
* The p_event_manager is immutable, so you don't have to hold the lock
*
* \param p_ml a media list instance
* \param p_ex an excpetion instance
* \return libvlc_event_manager
*/
VLC_PUBLIC_API libvlc_event_manager_t *
libvlc_media_list_event_manager( libvlc_media_list_t *,
libvlc_exception_t * );
libvlc_media_list_event_manager( libvlc_media_list_t *p_ml );
/** @} media_list */
......
......@@ -148,7 +148,7 @@ import_mlist_rec( libvlc_media_list_view_t * p_mlv,
libvlc_exception_t * p_e )
{
int i, count;
count = libvlc_media_list_count( p_mlist, p_e );
count = libvlc_media_list_count( p_mlist );
for( i = 0; i < count; i++ )
{
libvlc_media_t * p_md;
......
......@@ -53,7 +53,8 @@ static int
hierarch_media_list_view_count( libvlc_media_list_view_t * p_mlv,
libvlc_exception_t * p_e )
{
return libvlc_media_list_count( p_mlv->p_mlist, p_e );
VLC_UNUSED(p_e);
return libvlc_media_list_count( p_mlv->p_mlist );
}
/**************************************************************************
......
......@@ -59,7 +59,7 @@ hierarch_node_media_list_view_count( libvlc_media_list_view_t * p_mlv,
libvlc_exception_t * p_e )
{
/* FIXME: we may want to cache that */
int i, ret, count = libvlc_media_list_count( p_mlv->p_mlist, p_e );
int i, ret, count = libvlc_media_list_count( p_mlv->p_mlist );
libvlc_media_t * p_md;
libvlc_media_list_t * p_submlist;
ret = 0;
......@@ -90,7 +90,7 @@ hierarch_node_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
libvlc_media_t * p_md;
libvlc_media_list_t * p_submlist;
trace("%d\n", index);
int i, current_index, count = libvlc_media_list_count( p_mlv->p_mlist, p_e );
int i, current_index, count = libvlc_media_list_count( p_mlv->p_mlist );
current_index = -1;
for( i = 0; i < count; i++ )
{
......@@ -140,7 +140,7 @@ index_of_item( libvlc_media_list_view_t * p_mlv, libvlc_media_t * p_md )
libvlc_media_t * p_iter_md;
libvlc_media_list_t * p_submlist;
int i, current_index, count = libvlc_media_list_count( p_mlv->p_mlist, NULL );
int i, current_index, count = libvlc_media_list_count( p_mlv->p_mlist );
current_index = -1;
for( i = 0; i < count; i++ )
{
......@@ -164,7 +164,7 @@ item_is_already_added( libvlc_media_t * p_md )
p_submlist = libvlc_media_subitems( p_md );
if( !p_submlist ) return false;
int count = libvlc_media_list_count( p_submlist, NULL );
int count = libvlc_media_list_count( p_submlist );
libvlc_media_list_release( p_submlist );
return count > 1;
}
......
......@@ -102,7 +102,7 @@ static void input_item_subitem_added( const vlc_event_t *p_event,
if( !p_md->p_subitems )
{
p_md->p_subitems = libvlc_media_list_new( p_md->p_libvlc_instance, NULL );
libvlc_media_list_set_media( p_md->p_subitems, p_md, NULL );
libvlc_media_list_set_media( p_md->p_subitems, p_md );
}
if( p_md->p_subitems )
{
......
......@@ -88,7 +88,7 @@ static void services_discovery_item_added( const vlc_event_t * p_event,
/* Insert the md into the root list */
libvlc_media_list_lock( p_mdis->p_mlist );
_libvlc_media_list_add_media( p_mdis->p_mlist, p_catmd, NULL );
_libvlc_media_list_add_media( p_mdis->p_mlist, p_catmd );
libvlc_media_list_unlock( p_mdis->p_mlist );
/* We don't release the mlist cause the dictionary
......@@ -98,7 +98,7 @@ static void services_discovery_item_added( const vlc_event_t * p_event,
}
libvlc_media_list_lock( p_mlist );
_libvlc_media_list_add_media( p_mlist, p_md, NULL );
_libvlc_media_list_add_media( p_mlist, p_md );
libvlc_media_list_unlock( p_mlist );
libvlc_media_release( p_md );
......@@ -115,7 +115,7 @@ static void services_discovery_item_removed( const vlc_event_t * p_event,
libvlc_media_t * p_md;
libvlc_media_discoverer_t * p_mdis = user_data;
int i, count = libvlc_media_list_count( p_mdis->p_mlist, NULL );
int i, count = libvlc_media_list_count( p_mdis->p_mlist );
libvlc_media_list_lock( p_mdis->p_mlist );
for( i = 0; i < count; i++ )
{
......
......@@ -288,11 +288,9 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
* set_media (Public)
**************************************************************************/
void libvlc_media_list_set_media( libvlc_media_list_t * p_mlist,
libvlc_media_t * p_md,
libvlc_exception_t * p_e)
libvlc_media_t * p_md )
{
VLC_UNUSED(p_e);
vlc_mutex_lock( &p_mlist->object_lock );
libvlc_media_release( p_mlist->p_md );
libvlc_media_retain( p_md );
......@@ -310,11 +308,9 @@ void libvlc_media_list_set_media( libvlc_media_list_t * p_mlist,
* media.
**************************************************************************/
libvlc_media_t *
libvlc_media_list_media( libvlc_media_list_t * p_mlist,
libvlc_exception_t * p_e)
libvlc_media_list_media( libvlc_media_list_t * p_mlist )
{
libvlc_media_t *p_md;
VLC_UNUSED(p_e);
vlc_mutex_lock( &p_mlist->object_lock );
p_md = p_mlist->p_md;
......@@ -328,12 +324,10 @@ libvlc_media_list_media( libvlc_media_list_t * p_mlist,
/**************************************************************************
* libvlc_media_list_count (Public)
*
* Lock should be hold when entering.
* Lock should be held when entering.
**************************************************************************/
int libvlc_media_list_count( libvlc_media_list_t * p_mlist,
libvlc_exception_t * p_e )
int libvlc_media_list_count( libvlc_media_list_t * p_mlist )
{
VLC_UNUSED(p_e);
return vlc_array_count( &p_mlist->items );
}
......@@ -348,16 +342,13 @@ void libvlc_media_list_add_media(
libvlc_exception_t * p_e )
{
if( mlist_is_writable(p_mlist,p_e) )
_libvlc_media_list_add_media( p_mlist, p_md, p_e );
_libvlc_media_list_add_media( p_mlist, p_md );
}
/* LibVLC internal version */
void _libvlc_media_list_add_media(
libvlc_media_list_t * p_mlist,
libvlc_media_t * p_md,
libvlc_exception_t * p_e )
void _libvlc_media_list_add_media( libvlc_media_list_t * p_mlist,
libvlc_media_t * p_md )
{
VLC_UNUSED(p_e);
libvlc_media_retain( p_md );
notify_item_addition( p_mlist, p_md, vlc_array_count( &p_mlist->items ),
......@@ -379,17 +370,15 @@ void libvlc_media_list_insert_media(
libvlc_exception_t * p_e )
{
if( mlist_is_writable(p_mlist,p_e) )
_libvlc_media_list_insert_media( p_mlist, p_md, index, p_e );
_libvlc_media_list_insert_media( p_mlist, p_md, index );
}
/* LibVLC internal version */
void _libvlc_media_list_insert_media(
libvlc_media_list_t * p_mlist,
libvlc_media_t * p_md,
int index,
libvlc_exception_t * p_e )
int index )
{
VLC_UNUSED(p_e);
libvlc_media_retain( p_md );
notify_item_addition( p_mlist, p_md, index, EventWillHappen );
......@@ -464,11 +453,8 @@ libvlc_media_list_item_at_index( libvlc_media_list_t * p_mlist,
* Warning: this function returns the first matching item.
**************************************************************************/
int libvlc_media_list_index_of_item( libvlc_media_list_t * p_mlist,
libvlc_media_t * p_searched_md,
libvlc_exception_t * p_e )
libvlc_media_t * p_searched_md )
{
VLC_UNUSED(p_e);
libvlc_media_t * p_md;
int i;
for ( i = 0; i < vlc_array_count( &p_mlist->items ); i++ )
......@@ -519,9 +505,7 @@ void libvlc_media_list_unlock( libvlc_media_list_t * p_mlist )
* The p_event_manager is immutable, so you don't have to hold the lock
**************************************************************************/
libvlc_event_manager_t *
libvlc_media_list_event_manager( libvlc_media_list_t * p_mlist,
libvlc_exception_t * p_e )
libvlc_media_list_event_manager( libvlc_media_list_t * p_mlist )
{
VLC_UNUSED(p_e);
return p_mlist->p_event_manager;
}
......@@ -58,13 +58,11 @@ struct libvlc_media_list_t
/* Media List */
void _libvlc_media_list_add_media(
libvlc_media_list_t * p_mlist,
libvlc_media_t * p_md,
libvlc_exception_t * p_e );
libvlc_media_t * p_md );
void _libvlc_media_list_insert_media(
libvlc_media_list_t * p_mlist,
libvlc_media_t * p_md, int index,
libvlc_exception_t * p_e );
libvlc_media_t * p_md, int index );
void _libvlc_media_list_remove_index(
libvlc_media_list_t * p_mlist, int index,
......
......@@ -119,7 +119,7 @@ static libvlc_media_list_path_t
get_path_rec( const libvlc_media_list_path_t path, libvlc_media_list_t * p_current_mlist, libvlc_media_t * p_searched_md )
{
int i, count;
count = libvlc_media_list_count( p_current_mlist, NULL );
count = libvlc_media_list_count( p_current_mlist );
for( i = 0; i < count; i++ )
{
libvlc_media_t * p_md = libvlc_media_list_item_at_index( p_current_mlist, i, NULL );
......
......@@ -116,7 +116,7 @@ static inline void assert_locked(libvlc_media_list_player_t * p_mlp)
static inline libvlc_event_manager_t * mlist_em(libvlc_media_list_player_t * p_mlp)
{
assert_locked(p_mlp);
return libvlc_media_list_event_manager(p_mlp->p_mlist, NULL);
return libvlc_media_list_event_manager(p_mlp->p_mlist);
}
static inline libvlc_event_manager_t * mplayer_em(libvlc_media_list_player_t * p_mlp)
......@@ -144,7 +144,7 @@ get_next_path(libvlc_media_list_player_t * p_mlp, bool b_loop)
if (!p_mlp->current_playing_item_path)
{
if (!libvlc_media_list_count(p_mlp->p_mlist, NULL))
if (!libvlc_media_list_count(p_mlp->p_mlist))
return NULL;
return libvlc_media_list_path_with_root_index(0);
}
......@@ -172,7 +172,7 @@ get_next_path(libvlc_media_list_player_t * p_mlp, bool b_loop)
ret[depth - 1]++; /* set to next element */
/* If this goes beyond the end of the list */
while(ret[depth-1] >= libvlc_media_list_count(p_parent_of_playing_item, NULL))
while(ret[depth-1] >= libvlc_media_list_count(p_parent_of_playing_item))
{
depth--;
if (depth <= 0)
......@@ -218,7 +218,7 @@ find_last_item( libvlc_media_list_t * p_mlist, libvlc_media_list_path_t current_
if(p_sublist)
{
int i_count = libvlc_media_list_count(p_sublist, NULL);
int i_count = libvlc_media_list_count(p_sublist);
if(i_count > 0)
{
/* Add the last sublist item to the path. */
......@@ -252,7 +252,7 @@ get_previous_path(libvlc_media_list_player_t * p_mlp, bool b_loop)
if (!p_mlp->current_playing_item_path)
{
if (!libvlc_media_list_count(p_mlp->p_mlist, NULL))
if (!libvlc_media_list_count(p_mlp->p_mlist))
return NULL;
return libvlc_media_list_path_with_root_index(0);
}
......@@ -285,7 +285,7 @@ get_previous_path(libvlc_media_list_player_t * p_mlp, bool b_loop)
// Is looping enabled?
if(b_loop)
{
int i_count = libvlc_media_list_count(p_parent_of_playing_item, NULL);
int i_count = libvlc_media_list_count(p_parent_of_playing_item);
/* Set current play item to the last element in the list */
ret[0] = i_count - 1;
......
......@@ -64,7 +64,7 @@ install_md_listener( libvlc_media_list_view_t * p_mlv,
if((p_mlist = libvlc_media_subitems( p_md )))
{
libvlc_media_list_lock( p_mlist );
int i, count = libvlc_media_list_count( p_mlist, NULL );
int i, count = libvlc_media_list_count( p_mlist );
for( i = 0; i < count; i++)
{
libvlc_event_t added_event;
......@@ -116,7 +116,7 @@ uninstall_md_listener( libvlc_media_list_view_t * p_mlv,
libvlc_MediaListItemDeleted,
media_list_item_removed, p_mlv );
int i, count = libvlc_media_list_count( p_mlist, NULL );
int i, count = libvlc_media_list_count( p_mlist );
for( i = 0; i < count; i++)
{
libvlc_media_t * p_submd;
......@@ -203,7 +203,7 @@ libvlc_media_list_view_set_ml_notification_callback(
libvlc_event_attach( p_mlv->p_mlist->p_event_manager,
libvlc_MediaListItemDeleted,
media_list_item_removed, p_mlv, NULL );
int i, count = libvlc_media_list_count( p_mlv->p_mlist, NULL );
int i, count = libvlc_media_list_count( p_mlv->p_mlist );
for( i = 0; i < count; i++)
{
libvlc_media_t * p_md;
......@@ -387,7 +387,7 @@ libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv )
libvlc_MediaListItemDeleted,
media_list_item_removed, p_mlv );
}
int i, count = libvlc_media_list_count( p_mlv->p_mlist, NULL );
int i, count = libvlc_media_list_count( p_mlv->p_mlist );
for( i = 0; i < count; i++)
{
libvlc_media_t * p_md;
......
......@@ -50,41 +50,31 @@ static void test_media_list (const char ** argv, int argc)
libvlc_media_list_add_media (ml, md2, &ex);
catch ();
assert( libvlc_media_list_count (ml, &ex) == 2 );
catch ();
assert( libvlc_media_list_index_of_item (ml, md1, &ex) == 0 );
catch ();
assert( libvlc_media_list_index_of_item (ml, md2, &ex) == 1 );
catch ();
assert( libvlc_media_list_count (ml) == 2 );
assert( libvlc_media_list_index_of_item (ml, md1) == 0 );
assert( libvlc_media_list_index_of_item (ml, md2) == 1 );
libvlc_media_list_remove_index (ml, 0, &ex); /* removing first item */
catch ();
/* test if second item was moved on first place */
assert( libvlc_media_list_index_of_item (ml, md2, &ex) == 0 );
catch ();
assert( libvlc_media_list_index_of_item (ml, md2) == 0 );
libvlc_media_list_add_media (ml, md1, &ex); /* add 2 items */
catch ();
libvlc_media_list_add_media (ml, md1, &ex);
catch ();
/* there should be 3 pieces */
assert( libvlc_media_list_count (ml, &ex) == 3 );
catch ();
assert( libvlc_media_list_count (ml) == 3 );
libvlc_media_list_insert_media (ml, md3, 2, &ex);
catch ();
/* there should be 4 pieces */
assert( libvlc_media_list_count (ml, &ex) == 4 );
catch ();
assert( libvlc_media_list_count (ml) == 4 );
/* test inserting on right place */
assert( libvlc_media_list_index_of_item (ml, md3, &ex) == 2 );
catch ();
assert( libvlc_media_list_index_of_item (ml, md3) == 2 );
/* test right returning descriptor*/
assert ( libvlc_media_list_item_at_index (ml, 0, &ex) == md2 );
......@@ -120,7 +110,7 @@ static void test_media_list (const char ** argv, int argc)
/* try to find non inserted item */
int i_non_exist = 0;
i_non_exist = libvlc_media_list_index_of_item (ml, md4, &ex);
i_non_exist = libvlc_media_list_index_of_item (ml, md4);
assert ( i_non_exist == -1 );
libvlc_media_release (md1);
......
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