]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/dialogs/wizard.cpp
s/pl_Yield/pl_Hold/
[vlc] / modules / gui / wxwidgets / dialogs / wizard.cpp
index c8235ecfcdb3a587426b15d2eeb26973b570f421..9a677355d040271d6c97898002d463fa55419f8b 100644 (file)
@@ -577,9 +577,7 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
     openSizer->Fit(open_panel);
     mainSizer->Add( open_panel );
 
-    playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
-                                       VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
-
+    playlist_t *p_playlist = pl_Hold( p_intf );
     if( p_playlist )
     {
         if( !playlist_IsEmpty( p_playlist ) )
@@ -601,7 +599,7 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
         {
             input_radios[1]->Disable();
         }
-        vlc_object_release( p_playlist );
+        pl_Release( p_intf );
     }
     else
     {
@@ -717,11 +715,10 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event)
         if( i != -1 )
         {
             long data = listview->GetItemData( i );
-            playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
-                                      VLC_OBJECT_PLAYLIST, FIND_ANYWHERE);
+            playlist_t *p_playlist = pl_Hold( p_intf );
             if( p_playlist )
             {
-                playlist_item_t * p_item = playlist_ItemGetById(                                                   p_playlist, (int)data, false );
+                playlist_item_t * p_item = playlist_ItemGetById( p_playlist, (int)data, false );
                 if( p_item )
                 {
                     const char *psz_uri = input_item_GetURI( p_item->p_input );
@@ -730,6 +727,7 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event)
                 }
                 else
                     event.Veto();
+                pl_Release( p_intf );
             }
             else
                 event.Veto();
@@ -1608,34 +1606,34 @@ void WizardDialog::Run()
             free( psz_sap_option );
         }
 
-        playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
-                            VLC_OBJECT_PLAYLIST, FIND_ANYWHERE);
+        playlist_t *p_playlist = pl_Hold( p_intf );
         if( p_playlist )
         {
-            input_item_t *p_input = input_ItemNew( p_playlist, mrl,
+            input_item_t *p_input = input_item_New( p_playlist, mrl,
                                                    ITEM_NAME );
-            input_ItemAddOption( p_input, psz_opt );
+            input_item_AddOption( p_input, psz_opt );
             if( i_from != 0)
             {
                 char psz_from[20];
                 snprintf( psz_from, 20, "start-time=%i", i_from);
-                input_ItemAddOption( p_input, psz_from );
+                input_item_AddOption( p_input, psz_from );
             }
             if( i_to != 0)
             {
                 char psz_to[20];
                 snprintf( psz_to, 20, "stop-time=%i", i_to);
-                input_ItemAddOption( p_input, psz_to );
+                input_item_AddOption( p_input, psz_to );
             }
 
             char psz_ttl[20];
             snprintf( psz_ttl, 20, "ttl=%i",i_ttl );
-            input_ItemAddOption( p_input, psz_ttl );
+            input_item_AddOption( p_input, psz_ttl );
 
             /* FIXME: playlist_AddInput() can fail */
             playlist_AddInput( p_playlist, p_input,
-                               PLAYLIST_GO, PLAYLIST_END, true, false );
-            vlc_object_release(p_playlist);
+                               PLAYLIST_GO, PLAYLIST_END, true, pl_Unlocked );
+            vlc_gc_decref( p_input );
+            pl_Release( p_intf );
         }
         else
         {