]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/dialogs/bookmarks.cpp
Use pl_Release with the right argument.
[vlc] / modules / gui / wxwidgets / dialogs / bookmarks.cpp
index 7759c3ed0db9cee065ecdca70a944c8d37db60bd..864a86b59049d18a9c3ad881ed945879e11075c4 100644 (file)
@@ -118,11 +118,11 @@ BookmarkEditDialog::~BookmarkEditDialog()
 }
 void BookmarkEditDialog::OnOK( wxCommandEvent &event )
 {
-    if( p_seekpoint->psz_name ) free( p_seekpoint->psz_name );
-    p_seekpoint->psz_name = strdup( name_text->GetValue().mb_str() );
-    p_seekpoint->i_byte_offset = atoi( bytes_text->GetValue().mb_str() );
+    free( p_seekpoint->psz_name );
+    p_seekpoint->psz_name = strdup( name_text->GetValue().mb_str(wxConvUTF8) );
+    p_seekpoint->i_byte_offset = atoi( bytes_text->GetValue().mb_str(wxConvUTF8) );
     p_seekpoint->i_time_offset =  1000000 *
-                                  atoll( time_text->GetValue().mb_str() ) ;
+                                  atoll( time_text->GetValue().mb_str(wxConvUTF8) ) ;
     EndModal( wxID_OK );
 }
 
@@ -166,13 +166,13 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf, wxWindow *p_parent )
     wxButton *button_extract =
         new wxButton( panel, ButtonExtract_Event, wxU(_("Extract")) );
 
-#define ADD_TEXT "Adds a bookmark at the current position in the stream"
-#define REMOVE_TEXT "Removes the selected bookmarks"
-#define CLEAR_TEXT "Removes all the bookmarks for that stream"
-#define EDIT_TEXT "Edit the properties of a bookmark"
-#define EXTRACT_TEXT "If you select two or more bookmarks, this will " \
+#define ADD_TEXT N_("Adds a bookmark at the current position in the stream")
+#define REMOVE_TEXT N_("Removes the selected bookmarks")
+#define CLEAR_TEXT N_("Removes all the bookmarks for that stream")
+#define EDIT_TEXT N_("Edit the properties of a bookmark")
+#define EXTRACT_TEXT N_("If you select two or more bookmarks, this will " \
                "launch the streaming/transcoding wizard to allow you to " \
-              "stream or save the part of the stream between these bookmarks"
+              "stream or save the part of the stream between these bookmarks")
     button_add->SetToolTip(  wxU(_( ADD_TEXT ) ) );
     button_del->SetToolTip(  wxU(_( REMOVE_TEXT ) ) );
     button_clear->SetToolTip(  wxU(_( CLEAR_TEXT ) ) );
@@ -204,28 +204,24 @@ BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf, wxWindow *p_parent )
     main_sizer->Add( main_panel, 1, wxEXPAND );
     SetSizer( main_sizer );
 
-    playlist_t *p_playlist =
-        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
-                                       FIND_ANYWHERE );
+    playlist_t *p_playlist = pl_Yield( p_intf );
     if( p_playlist )
     {
        /* Some global changes happened -> Rebuild all */
        var_AddCallback( p_playlist, "playlist-current",
                         PlaylistChanged, this );
-       vlc_object_release( p_playlist );
+       pl_Release( p_intf );
     }
 }
 
 BookmarksDialog::~BookmarksDialog()
 {
-    playlist_t *p_playlist =
-        (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
-                                       FIND_ANYWHERE );
+    playlist_t *p_playlist = pl_Yield( p_intf );
     if( p_playlist )
     {
        var_DelCallback( p_playlist, "playlist-current",
                         PlaylistChanged, this );
-       vlc_object_release( p_playlist );
+       pl_Release( p_intf );
     }
 }
 
@@ -373,10 +369,12 @@ void BookmarksDialog::OnExtract( wxCommandEvent& event )
 
     if( i_first < i_bookmarks && i_second <= i_bookmarks )
     {
+        char *psz_uri = input_item_GetURI( input_GetItem( p_input ) );
         WizardDialog *p_wizard_dialog = new WizardDialog( p_intf, this,
-                               p_input->input.p_item->psz_uri,
+                               psz_uri,
                                pp_bookmarks[i_first]->i_time_offset/1000000,
                                pp_bookmarks[i_second]->i_time_offset/1000000 );
+        free( psz_uri );
         vlc_object_release( p_input );
         if( p_wizard_dialog )
         {