]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/bookmarks.m
Remove unused VOUT_PARENT
[vlc] / modules / gui / macosx / bookmarks.m
index 5c562b058101a0b8ef7939c8ab7fb2a56afd9a00..19a9c0f2ee7da6bf2be4236228858fc0f0291806 100644 (file)
@@ -76,8 +76,6 @@ static VLCBookmarks *_o_sharedInstance = nil;
 
 - (void)dealloc
 {
-    if( p_old_input )
-        vlc_object_release( p_old_input );
     [super dealloc];
 }
 
@@ -122,17 +120,12 @@ static VLCBookmarks *_o_sharedInstance = nil;
     if( !p_input ) return;
  
     seekpoint_t bookmark;
-    vlc_value_t pos;
-    bookmark.psz_name = NULL;
-    bookmark.i_byte_offset = 0;
-    bookmark.i_time_offset = 0;
-    var_Get( VLCIntf, "position", &pos);
-    bookmark.psz_name = _("Untitled");
-    input_Control( p_input, INPUT_GET_BYTE_POSITION, &bookmark.i_byte_offset );
-    var_Get( p_input, "time", &pos );
-    bookmark.i_time_offset = pos.i_time;
-    input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
+
+    if( !input_Control( p_input, INPUT_GET_BOOKMARK, &bookmark ) )
+       {
+               bookmark.psz_name = _("Untitled");
+               input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
+       }
  
     vlc_object_release( p_input );
  
@@ -188,6 +181,9 @@ static VLCBookmarks *_o_sharedInstance = nil;
             pp_bookmarks[row]->i_byte_offset] stringValue]];
     }
  
+    /* Just keep the pointer value to check if it
+     * changes. Note, we don't need to keep a reference to the object.
+     * so release it now. */
     p_old_input = p_input;
     vlc_object_release( p_input );
 
@@ -369,7 +365,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
  * data source methods
  *****************************************************************************/
 
-- (int)numberOfRowsInTableView:(NSTableView *)theDataTable
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)theDataTable
 {
     /* return the number of bookmarks */
     input_thread_t * p_input = pl_CurrentInput( VLCIntf );
@@ -390,7 +386,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
 }
 
 - (id)tableView:(NSTableView *)theDataTable objectValueForTableColumn:
-    (NSTableColumn *)theTableColumn row: (int)row
+    (NSTableColumn *)theTableColumn row: (NSInteger)row
 {
     /* return the corresponding data as NSString */
     input_thread_t * p_input = pl_CurrentInput( VLCIntf );