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

src: helper for command line item handling

parent 11405d4d
......@@ -162,6 +162,18 @@ playlist_t *(pl_Get)(vlc_object_t *obj)
return pl;
}
/**
* Inserts an item in the playlist used by interfaces.
* @note This function may <b>not</b> be called at the same time as
* intf_DestroyAll().
*/
void intf_InsertItem(libvlc_int_t *libvlc, const char *mrl, unsigned optc,
const char *const *optv, unsigned flags)
{
playlist_AddExt(intf_GetPlaylist(libvlc), mrl, NULL, PLAYLIST_INSERT,
0, -1, optc, optv, flags, true, pl_Unlocked);
}
/**
* Stops and destroys all interfaces
* @param p_libvlc the LibVLC instance
......
......@@ -504,8 +504,7 @@ dbus_out:
psz_val = var_InheritString( p_libvlc, "open" );
if ( psz_val != NULL )
{
playlist_AddExt( pl_Get(p_libvlc), psz_val, NULL, PLAYLIST_INSERT, 0,
-1, 0, NULL, 0, true, pl_Unlocked );
intf_InsertItem( p_libvlc, psz_val, 0, NULL, 0 );
free( psz_val );
}
......@@ -650,10 +649,9 @@ static void GetFilenames( libvlc_int_t *p_vlc, unsigned n,
continue;
}
playlist_AddExt( pl_Get( p_vlc ), (mrl != NULL) ? mrl : args[n], NULL,
PLAYLIST_INSERT, 0, -1, i_options,
intf_InsertItem( p_vlc, (mrl != NULL) ? mrl : args[n], i_options,
( i_options ? &args[n + 1] : NULL ),
VLC_INPUT_OPTION_TRUSTED, true, pl_Unlocked );
VLC_INPUT_OPTION_TRUSTED );
free( mrl );
}
}
......
......@@ -178,6 +178,8 @@ static inline libvlc_priv_t *libvlc_priv (libvlc_int_t *libvlc)
return (libvlc_priv_t *)libvlc;
}
void intf_InsertItem(libvlc_int_t *, const char *mrl, unsigned optc,
const char * const *optv, unsigned flags);
void intf_DestroyAll( libvlc_int_t * );
#define libvlc_stats( o ) (libvlc_priv((VLC_OBJECT(o))->p_libvlc)->b_stats)
......
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