Commit f6f321dc authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

FIx mozilla plugin compilation

parent 1f716cb7
......@@ -708,8 +708,8 @@ LibvlcPlaylistItemsNPObject::invoke(int index, const NPVariant *args,
case ID_playlistitems_remove:
if( (argCount == 1) && isNumberValue(args[0]) )
{
p_plugin->playlist_delete_item(numberValue(args[0]),&ex);
RETURN_ON_EXCEPTION(this,ex);
if( !p_plugin->playlist_delete_item(numberValue(args[0])) )
return INVOKERESULT_GENERIC_ERROR;
VOID_TO_NPVARIANT(result);
return INVOKERESULT_NO_ERROR;
}
......@@ -971,8 +971,8 @@ LibvlcPlaylistNPObject::invoke(int index, const NPVariant *args,
case ID_playlist_removeitem: /* deprecated */
if( (argCount == 1) && isNumberValue(args[0]) )
{
p_plugin->playlist_delete_item(numberValue(args[0]), &ex);
RETURN_ON_EXCEPTION(this,ex);
if( !p_plugin->playlist_delete_item(numberValue(args[0])) )
return INVOKERESULT_GENERIC_ERROR;
VOID_TO_NPVARIANT(result);
return INVOKERESULT_NO_ERROR;
}
......
......@@ -457,8 +457,7 @@ int VlcPlugin::playlist_add( const char *mrl, libvlc_exception_t *ex )
return -1;
libvlc_media_list_lock(libvlc_media_list);
libvlc_media_list_add_media(libvlc_media_list,p_m,ex);
if( !libvlc_exception_raised(ex) )
if( !libvlc_media_list_add_media(libvlc_media_list,p_m) )
item = libvlc_media_list_count(libvlc_media_list)-1;
libvlc_media_list_unlock(libvlc_media_list);
......@@ -479,8 +478,7 @@ int VlcPlugin::playlist_add_extended_untrusted( const char *mrl, const char *nam
libvlc_media_add_option_flag(p_m, optv[i], libvlc_media_option_unique);
libvlc_media_list_lock(libvlc_media_list);
libvlc_media_list_add_media(libvlc_media_list,p_m,ex);
if( !libvlc_exception_raised(ex) )
if( !libvlc_media_list_add_media(libvlc_media_list,p_m) )
item = libvlc_media_list_count(libvlc_media_list)-1;
libvlc_media_list_unlock(libvlc_media_list);
libvlc_media_release(p_m);
......@@ -501,10 +499,10 @@ bool VlcPlugin::playlist_select( int idx, libvlc_exception_t *ex )
playlist_index = idx;
p_m = libvlc_media_list_item_at_index(libvlc_media_list,playlist_index,ex);
p_m = libvlc_media_list_item_at_index(libvlc_media_list,playlist_index);
libvlc_media_list_unlock(libvlc_media_list);
if( libvlc_exception_raised(ex) )
if( !p_m )
return false;
if( libvlc_media_player )
......@@ -531,11 +529,12 @@ bad_unlock:
return false;
}
void VlcPlugin::playlist_delete_item( int idx, libvlc_exception_t *ex )
int VlcPlugin::playlist_delete_item( int idx )
{
libvlc_media_list_lock(libvlc_media_list);
libvlc_media_list_remove_index(libvlc_media_list,idx,ex);
int ret = libvlc_media_list_remove_index(libvlc_media_list,idx);
libvlc_media_list_unlock(libvlc_media_list);
return ret;
}
void VlcPlugin::playlist_clear()
......
......@@ -266,7 +266,7 @@ public:
int playlist_add( const char *, libvlc_exception_t * );
int playlist_add_extended_untrusted( const char *, const char *, int,
const char **, libvlc_exception_t * );
void playlist_delete_item( int, libvlc_exception_t * );
int playlist_delete_item( int );
void playlist_clear();
int playlist_count();
......
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