Commit ff4982c0 authored by David Fuhrmann's avatar David Fuhrmann

macosx: always delete stored input thread on change (close #14850)

parent 74a86318
...@@ -1320,9 +1320,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1320,9 +1320,7 @@ static VLCMain *_o_sharedMainInstance = nil;
// This must be called on main thread // This must be called on main thread
- (void)PlaylistItemChanged - (void)PlaylistItemChanged
{ {
input_thread_t *p_input_changed = NULL; if (p_current_input) {
if (p_current_input && p_current_input->b_dead) {
var_DelCallback(p_current_input, "intf-event", InputEvent, [VLCMain sharedInstance]); var_DelCallback(p_current_input, "intf-event", InputEvent, [VLCMain sharedInstance]);
vlc_object_release(p_current_input); vlc_object_release(p_current_input);
p_current_input = NULL; p_current_input = NULL;
...@@ -1332,27 +1330,28 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1332,27 +1330,28 @@ static VLCMain *_o_sharedMainInstance = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:VLCInputChangedNotification [[NSNotificationCenter defaultCenter] postNotificationName:VLCInputChangedNotification
object:nil]; object:nil];
} }
else if (!p_current_input) {
// object is hold here and released then it is dead
p_current_input = playlist_CurrentInput(pl_Get(VLCIntf));
if (p_current_input) {
var_AddCallback(p_current_input, "intf-event", InputEvent, [VLCMain sharedInstance]);
[self playbackStatusUpdated];
[o_mainmenu setRateControlsEnabled: YES];
if ([self activeVideoPlayback] && [[o_mainwindow videoView] isHidden]) {
[o_mainwindow changePlaylistState: psPlaylistItemChangedEvent];
}
p_input_changed = vlc_object_hold(p_current_input); input_thread_t *p_input_changed = NULL;
[[self playlist] currentlyPlayingItemChanged];
[[self playlist] continuePlaybackWhereYouLeftOff:p_current_input]; // object is hold here and released then it is dead
p_current_input = playlist_CurrentInput(pl_Get(VLCIntf));
if (p_current_input) {
var_AddCallback(p_current_input, "intf-event", InputEvent, [VLCMain sharedInstance]);
[self playbackStatusUpdated];
[o_mainmenu setRateControlsEnabled: YES];
[[NSNotificationCenter defaultCenter] postNotificationName:VLCInputChangedNotification if ([self activeVideoPlayback] && [[o_mainwindow videoView] isHidden]) {
object:nil]; [o_mainwindow changePlaylistState: psPlaylistItemChangedEvent];
} }
p_input_changed = vlc_object_hold(p_current_input);
[[self playlist] currentlyPlayingItemChanged];
[[self playlist] continuePlaybackWhereYouLeftOff:p_current_input];
[[NSNotificationCenter defaultCenter] postNotificationName:VLCInputChangedNotification
object:nil];
} }
[self updateMetaAndInfo]; [self updateMetaAndInfo];
......
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