[vlc-devel] commit: Add libvlc_playlist_add_extended_untrusted() ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Feb 4 17:00:52 CET 2009


vlc | branch: 0.9-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Feb  4 17:51:37 2009 +0200| [f77b039a872aeb58045106917741bec4e23ff340] | committer: Rémi Denis-Courmont 

Add libvlc_playlist_add_extended_untrusted()

Based on 059a3399daacd4532299d04cb2dd1a472cc25a83 by Laurent Aimar

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f77b039a872aeb58045106917741bec4e23ff340
---

 include/vlc/deprecated.h |   16 ++++++++++++++++
 src/control/playlist.c   |   34 ++++++++++++++++++++++++++--------
 src/libvlc.sym           |    1 +
 3 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/include/vlc/deprecated.h b/include/vlc/deprecated.h
index c683ecb..ba9a7be 100644
--- a/include/vlc/deprecated.h
+++ b/include/vlc/deprecated.h
@@ -216,6 +216,22 @@ VLC_DEPRECATED_API int libvlc_playlist_add_extended( libvlc_instance_t *, const
                                                  libvlc_exception_t * );
 
 /**
+ * Append an item to the playlist. The item is added at the end, with
+ * additional input options from an untrusted source.
+ *
+ * \param p_instance the playlist instance
+ * \param psz_uri the URI to open, using VLC format
+ * \param psz_name a name that you might want to give or NULL
+ * \param i_options the number of options to add
+ * \param ppsz_options strings representing the options to add
+ * \param p_e an initialized exception pointer
+ * \return the identifier of the new item
+ */
+VLC_DEPRECATED_API int libvlc_playlist_add_extended_untrusted( libvlc_instance_t *, const char *,
+                                                 const char *, int, const char **,
+                                                 libvlc_exception_t * );
+
+/**
  * Delete the playlist item with the given ID.
  *
  * \param p_instance the playlist instance
diff --git a/src/control/playlist.c b/src/control/playlist.c
index 4cd0ecc..86d6868 100644
--- a/src/control/playlist.c
+++ b/src/control/playlist.c
@@ -158,10 +158,11 @@ int libvlc_playlist_add( libvlc_instance_t *p_instance, const char *psz_uri,
                                          0, NULL, p_e );
 }
 
-int libvlc_playlist_add_extended( libvlc_instance_t *p_instance,
-                                  const char *psz_uri, const char *psz_name,
-                                  int i_options, const char **ppsz_options,
-                                  libvlc_exception_t *p_e )
+static int PlaylistAddExtended( libvlc_instance_t *p_instance,
+                                const char *psz_uri, const char *psz_name,
+                                int i_options, const char **ppsz_options,
+                                unsigned i_option_flags,
+                                libvlc_exception_t *p_e )
 {
     assert( PL );
     if( playlist_was_locked( p_instance ) )
@@ -170,11 +171,28 @@ int libvlc_playlist_add_extended( libvlc_instance_t *p_instance,
                                "calling libvlc_playlist_add" );
         return VLC_EGENERIC;
     }
-    return playlist_AddExt( PL, psz_uri, psz_name,
-                            PLAYLIST_INSERT, PLAYLIST_END, -1, ppsz_options,
-                            i_options, 1, pl_Unlocked );
+    return playlist_AddExtOpt( PL, psz_uri, psz_name, PLAYLIST_INSERT,
+                               PLAYLIST_END, -1, ppsz_options, i_options,
+                               i_option_flags, true, pl_Unlocked );
+}
+int libvlc_playlist_add_extended( libvlc_instance_t *p_instance,
+                                  const char *psz_uri, const char *psz_name,
+                                  int i_options, const char **ppsz_options,
+                                  libvlc_exception_t *p_e )
+{
+    return PlaylistAddExtended( p_instance, psz_uri, psz_name,
+                                i_options, ppsz_options, VLC_INPUT_OPTION_TRUSTED,
+                                p_e );
+}
+int libvlc_playlist_add_extended_untrusted( libvlc_instance_t *p_instance,
+                                            const char *psz_uri, const char *psz_name,
+                                            int i_options, const char **ppsz_options,
+                                            libvlc_exception_t *p_e )
+{
+    return PlaylistAddExtended( p_instance, psz_uri, psz_name,
+                                i_options, ppsz_options, 0,
+                                p_e );
 }
-
 
 int libvlc_playlist_delete_item( libvlc_instance_t *p_instance, int i_id,
                                  libvlc_exception_t *p_e )
diff --git a/src/libvlc.sym b/src/libvlc.sym
index c5f0f42..4fdb653 100644
--- a/src/libvlc.sym
+++ b/src/libvlc.sym
@@ -144,6 +144,7 @@ libvlc_media_subitems
 libvlc_new
 libvlc_playlist_add
 libvlc_playlist_add_extended
+libvlc_playlist_add_extended_untrusted
 libvlc_playlist_clear
 libvlc_playlist_delete_item
 libvlc_playlist_get_media_player




More information about the vlc-devel mailing list