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

LibVLC: remove last exception

parent 1dd84033
...@@ -79,22 +79,19 @@ VLC_PUBLIC_API void ...@@ -79,22 +79,19 @@ VLC_PUBLIC_API void
* Load media library. * Load media library.
* *
* \param p_mlib media library object * \param p_mlib media library object
* \param p_e an initialized exception object. * \return 0 on success, -1 on error
*/ */
VLC_PUBLIC_API void VLC_PUBLIC_API int
libvlc_media_library_load( libvlc_media_library_t * p_mlib, libvlc_media_library_load( libvlc_media_library_t * p_mlib );
libvlc_exception_t * p_e );
/** /**
* Get media library subitems. * Get media library subitems.
* *
* \param p_mlib media library object * \param p_mlib media library object
* \param p_e an initialized exception object.
* \return media list subitems * \return media list subitems
*/ */
VLC_PUBLIC_API libvlc_media_list_t * VLC_PUBLIC_API libvlc_media_list_t *
libvlc_media_library_media_list( libvlc_media_library_t * p_mlib, libvlc_media_library_media_list( libvlc_media_library_t * p_mlib );
libvlc_exception_t * p_e );
/** @} */ /** @} */
......
...@@ -70,10 +70,9 @@ VLC_PUBLIC_API void ...@@ -70,10 +70,9 @@ VLC_PUBLIC_API void
VLC_PUBLIC_API void VLC_PUBLIC_API void
libvlc_media_list_retain( libvlc_media_list_t * ); libvlc_media_list_retain( libvlc_media_list_t * );
VLC_DEPRECATED_API void VLC_DEPRECATED_API int
libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist, libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
const char * psz_uri, const char * psz_uri );
libvlc_exception_t * p_e );
/** /**
* Associate media instance with this media list instance. * Associate media instance with this media list instance.
......
...@@ -107,9 +107,7 @@ void libvlc_media_library_retain( libvlc_media_library_t * p_mlib ) ...@@ -107,9 +107,7 @@ void libvlc_media_library_retain( libvlc_media_library_t * p_mlib )
* *
* It doesn't yet load the playlists * It doesn't yet load the playlists
**************************************************************************/ **************************************************************************/
void int libvlc_media_library_load( libvlc_media_library_t * p_mlib )
libvlc_media_library_load( libvlc_media_library_t * p_mlib,
libvlc_exception_t * p_e )
{ {
char *psz_datadir = config_GetUserDir( VLC_DATA_DIR ); char *psz_datadir = config_GetUserDir( VLC_DATA_DIR );
char * psz_uri; char * psz_uri;
...@@ -122,9 +120,8 @@ libvlc_media_library_load( libvlc_media_library_t * p_mlib, ...@@ -122,9 +120,8 @@ libvlc_media_library_load( libvlc_media_library_t * p_mlib,
if( psz_uri == NULL ) if( psz_uri == NULL )
{ {
libvlc_exception_raise( p_e );
libvlc_printerr( "Not enough memory" ); libvlc_printerr( "Not enough memory" );
return; return -1;
} }
if( p_mlib->p_mlist ) if( p_mlib->p_mlist )
...@@ -132,19 +129,17 @@ libvlc_media_library_load( libvlc_media_library_t * p_mlib, ...@@ -132,19 +129,17 @@ libvlc_media_library_load( libvlc_media_library_t * p_mlib,
p_mlib->p_mlist = libvlc_media_list_new( p_mlib->p_libvlc_instance ); p_mlib->p_mlist = libvlc_media_list_new( p_mlib->p_libvlc_instance );
libvlc_media_list_add_file_content( p_mlib->p_mlist, psz_uri, p_e ); int ret = libvlc_media_list_add_file_content( p_mlib->p_mlist, psz_uri );
free( psz_uri ); free( psz_uri );
return; return ret;
} }
/************************************************************************** /**************************************************************************
* media_list (Public) * media_list (Public)
**************************************************************************/ **************************************************************************/
libvlc_media_list_t * libvlc_media_list_t *
libvlc_media_library_media_list( libvlc_media_library_t * p_mlib, libvlc_media_library_media_list( libvlc_media_library_t * p_mlib )
libvlc_exception_t * p_e )
{ {
(void)p_e;
if( p_mlib->p_mlist ) if( p_mlib->p_mlist )
libvlc_media_list_retain( p_mlib->p_mlist ); libvlc_media_list_retain( p_mlib->p_mlist );
return p_mlib->p_mlist; return p_mlib->p_mlist;
......
...@@ -242,10 +242,9 @@ void libvlc_media_list_retain( libvlc_media_list_t * p_mlist ) ...@@ -242,10 +242,9 @@ void libvlc_media_list_retain( libvlc_media_list_t * p_mlist )
/************************************************************************** /**************************************************************************
* add_file_content (Public) * add_file_content (Public)
**************************************************************************/ **************************************************************************/
void int
libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist, libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
const char * psz_uri, const char * psz_uri )
libvlc_exception_t * p_e )
{ {
input_item_t * p_input_item; input_item_t * p_input_item;
libvlc_media_t * p_md; libvlc_media_t * p_md;
...@@ -256,9 +255,8 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist, ...@@ -256,9 +255,8 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
if( !p_input_item ) if( !p_input_item )
{ {
libvlc_exception_raise( p_e );
libvlc_printerr( "Not enough memory" ); libvlc_printerr( "Not enough memory" );
return; return -1;
} }
p_md = libvlc_media_new_from_input_item( p_mlist->p_libvlc_instance, p_md = libvlc_media_new_from_input_item( p_mlist->p_libvlc_instance,
...@@ -266,18 +264,18 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist, ...@@ -266,18 +264,18 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
if( !p_md ) if( !p_md )
{ {
vlc_gc_decref( p_input_item ); vlc_gc_decref( p_input_item );
return; return -1;
} }
if( libvlc_media_list_add_media( p_mlist, p_md ) ) if( libvlc_media_list_add_media( p_mlist, p_md ) )
{ {
libvlc_exception_raise( p_e ); #warning Missing error handling!
return; /* printerr and leaks */
return -1;
} }
input_Read( p_mlist->p_libvlc_instance->p_libvlc_int, p_input_item ); input_Read( p_mlist->p_libvlc_instance->p_libvlc_int, p_input_item );
return 0;
return;
} }
/************************************************************************** /**************************************************************************
......
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