Commit 8299af70 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

control/media_list.c: read-only-fy add_media_descriptor().

parent c7e71cb6
......@@ -302,6 +302,11 @@ VLC_EXPORT (void, libvlc_media_descriptor_set_state,
( libvlc_media_descriptor_t *, libvlc_state_t, libvlc_exception_t * ) );
/* Media List */
VLC_EXPORT ( void, _libvlc_media_list_add_media_descriptor,
( libvlc_media_list_t * p_mlist,
libvlc_media_descriptor_t * p_md,
libvlc_exception_t * p_e ) );
VLC_EXPORT ( void, _libvlc_media_list_insert_media_descriptor,
( libvlc_media_list_t * p_mlist,
libvlc_media_descriptor_t * p_md,
......
......@@ -304,6 +304,22 @@ void libvlc_media_list_add_media_descriptor(
libvlc_media_list_t * p_mlist,
libvlc_media_descriptor_t * p_md,
libvlc_exception_t * p_e )
{
if( p_mlist->b_read_only )
{
/* We are read only from user side */
libvlc_exception_raise( p_e, "Trying to write into a read-only media list." );
return;
}
_libvlc_media_list_add_media_descriptor( p_mlist, p_md, p_e );
}
/* LibVLC internal version */
void _libvlc_media_list_add_media_descriptor(
libvlc_media_list_t * p_mlist,
libvlc_media_descriptor_t * p_md,
libvlc_exception_t * p_e )
{
(void)p_e;
libvlc_media_descriptor_retain( p_md );
......
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