Browse Source

macosx/playlist: fix refcounting when handling the current input item

pull/85/head
Felix Paul Kühne 8 years ago
parent
commit
7220f4f195
  1. 3
      modules/gui/macosx/menus/VLCStatusBarIcon.m
  2. 1
      modules/gui/macosx/playlist/VLCPlayerController.h
  3. 3
      modules/gui/macosx/playlist/VLCPlayerController.m
  4. 2
      modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m

3
modules/gui/macosx/menus/VLCStatusBarIcon.m

@ -258,6 +258,7 @@
}
[self setStoppedStatus:NO];
input_item_Release(p_item);
} else {
/* Nothing playing */
[progressField setStringValue:@"--:--"];
@ -375,6 +376,8 @@
album = toNSStr(tmp_cstr);
FREENULL(tmp_cstr);
}
input_item_Release(mediaItem);
} else {
/* Nothing playing */
title = _NS("VLC media player");

1
modules/gui/macosx/playlist/VLCPlayerController.h

@ -192,6 +192,7 @@ extern NSString *VLCPlayerMuteChanged;
/**
* get the current media item
* @return the current media item, NULL if none
* @note it is the receiver's obligation to release the input item
*/
@property (readonly, nullable) input_item_t * currentMedia;
/**

3
modules/gui/macosx/playlist/VLCPlayerController.m

@ -420,6 +420,9 @@ static const struct vlc_player_aout_cbs player_aout_callbacks = {
input_item_t *inputItem;
vlc_player_Lock(_p_player);
inputItem = vlc_player_GetCurrentMedia(_p_player);
if (inputItem) {
input_item_Hold(inputItem);
}
vlc_player_Unlock(_p_player);
return inputItem;
}

2
modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m

@ -315,6 +315,8 @@
negative:self.timeField.timeRemaining];
[self.timeField setStringValue:time];
[self.timeField setNeedsDisplay:YES];
input_item_Release(p_item);
}
- (void)updateControls

Loading…
Cancel
Save