Commit 04a19873 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Fix object refcount

* Fix some cosmetics
parent 28e2485a
...@@ -121,9 +121,10 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -121,9 +121,10 @@ static VLCBookmarks *_o_sharedInstance = nil;
{ {
/* add item to list */ /* add item to list */
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
input_thread_t * p_input = (input_thread_t *)vlc_object_find (p_intf, \ input_thread_t * p_input = (input_thread_t *)vlc_object_find( p_intf, \
VLC_OBJECT_INPUT, FIND_ANYWHERE); VLC_OBJECT_INPUT, FIND_ANYWHERE );
if (!p_input) return; if( !p_input )
return;
seekpoint_t bookmark; seekpoint_t bookmark;
vlc_value_t pos; vlc_value_t pos;
...@@ -150,7 +151,8 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -150,7 +151,8 @@ static VLCBookmarks *_o_sharedInstance = nil;
input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_intf, \ input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_intf, \
VLC_OBJECT_INPUT, FIND_ANYWHERE ); VLC_OBJECT_INPUT, FIND_ANYWHERE );
if( !p_input ) return; if( !p_input )
return;
input_Control( p_input, INPUT_CLEAR_BOOKMARKS ); input_Control( p_input, INPUT_CLEAR_BOOKMARKS );
...@@ -176,7 +178,7 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -176,7 +178,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
int row; int row;
row = [o_tbl_dataTable selectedRow]; row = [o_tbl_dataTable selectedRow];
if(!p_input) if( !p_input )
{ {
return; return;
} }
...@@ -222,7 +224,7 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -222,7 +224,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
seekpoint_t **pp_bookmarks; seekpoint_t **pp_bookmarks;
int i_bookmarks; int i_bookmarks, i;
input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_intf, \ input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_intf, \
VLC_OBJECT_INPUT, FIND_ANYWHERE ); VLC_OBJECT_INPUT, FIND_ANYWHERE );
...@@ -250,8 +252,7 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -250,8 +252,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
vlc_object_release( p_input ); vlc_object_release( p_input );
return; return;
} }
int i;
i = [o_tbl_dataTable selectedRow]; i = [o_tbl_dataTable selectedRow];
if( pp_bookmarks[i]->psz_name ) if( pp_bookmarks[i]->psz_name )
...@@ -408,15 +409,18 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -408,15 +409,18 @@ static VLCBookmarks *_o_sharedInstance = nil;
seekpoint_t **pp_bookmarks; seekpoint_t **pp_bookmarks;
int i_bookmarks; int i_bookmarks;
if(!p_input) if( !p_input )
{ {
return 0; return 0;
} else if( input_Control( p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, \ }
else if( input_Control( p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, \
&i_bookmarks ) != VLC_SUCCESS ) &i_bookmarks ) != VLC_SUCCESS )
{ {
vlc_object_release( p_input ); vlc_object_release( p_input );
return 0; return 0;
} else { }
else {
vlc_object_release( p_input );
return i_bookmarks; return i_bookmarks;
} }
} }
...@@ -435,7 +439,7 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -435,7 +439,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
int i_toBeReturned; int i_toBeReturned;
i_toBeReturned = 0; i_toBeReturned = 0;
if(!p_input) if( !p_input )
{ {
return @""; return @"";
} }
...@@ -444,7 +448,9 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -444,7 +448,9 @@ static VLCBookmarks *_o_sharedInstance = nil;
{ {
vlc_object_release( p_input ); vlc_object_release( p_input );
return @""; return @"";
} else { }
else
{
if ([[theTableColumn identifier] isEqualToString: @"description"]) if ([[theTableColumn identifier] isEqualToString: @"description"])
{ {
toBeReturned = pp_bookmarks[row]->psz_name; toBeReturned = pp_bookmarks[row]->psz_name;
...@@ -490,7 +496,9 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -490,7 +496,9 @@ static VLCBookmarks *_o_sharedInstance = nil;
[o_btn_edit setEnabled: NO]; [o_btn_edit setEnabled: NO];
[o_btn_rm setEnabled: NO]; [o_btn_rm setEnabled: NO];
[o_btn_extract setEnabled: NO]; [o_btn_extract setEnabled: NO];
} else { }
else
{
/* a row is selected */ /* a row is selected */
[o_btn_edit setEnabled: YES]; [o_btn_edit setEnabled: YES];
[o_btn_rm setEnabled: YES]; [o_btn_rm setEnabled: YES];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment