]> git.sesse.net Git - vlc/blobdiff - projects/mozilla/vlcplugin.cpp
mozilla: introduce new property text
[vlc] / projects / mozilla / vlcplugin.cpp
index 552d6fdad43fb9a780a511f1e6f5e19b90094110..3a49e8e4c7f6e04aa98465ccf09b58ff874ad82f 100644 (file)
@@ -45,6 +45,7 @@ VlcPlugin::VlcPlugin( NPP instance, uint16 mode ) :
     b_stream(0),
     b_autoplay(1),
     b_toolbar(0),
+    psz_text(NULL),
     psz_target(NULL),
     playlist_index(-1),
     libvlc_instance(NULL),
@@ -144,6 +145,10 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
         {
             psz_target = argv[i];
         }
+        else if( !strcmp( argn[i], "text" ) )
+        {
+            psz_text = strdup( argv[i] );
+        }
         else if( !strcmp( argn[i], "autoplay")
               || !strcmp( argn[i], "autostart") )
         {
@@ -266,6 +271,7 @@ VlcPlugin::~VlcPlugin()
 {
     free(psz_baseURL);
     free(psz_target);
+    free(psz_text);
     if( libvlc_media_player )
         libvlc_media_player_release( libvlc_media_player );
     if( libvlc_media_list )
@@ -322,7 +328,7 @@ int VlcPlugin::playlist_add_extended_untrusted( const char *mrl, const char *nam
 
     for( int i = 0; i < optc; ++i )
     {
-        libvlc_media_add_option_untrusted(p_m, optv[i],ex);
+        libvlc_media_add_option_flag(p_m, optv[i], libvlc_media_option_unique, ex);
         if( libvlc_exception_raised(ex) )
         {
             libvlc_media_release(p_m);