Commit 768657f4 authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix playbackstatusUpdated in case of ended inputs

As this method is called on main thread, END_S state was sometimes missed,
resulting in a missing update for the play buttons.
parent a9c71ebf
...@@ -1354,11 +1354,11 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1354,11 +1354,11 @@ static VLCMain *_o_sharedMainInstance = nil;
- (void)playbackStatusUpdated - (void)playbackStatusUpdated
{ {
input_thread_t * p_input; int state = -1;
if (p_current_input) {
state = var_GetInteger(p_current_input, "state");
}
p_input = pl_CurrentInput(p_intf);
if (p_input) {
int state = var_GetInteger(p_input, "state");
if (state == PLAYING_S) { if (state == PLAYING_S) {
/* Declare user activity. /* Declare user activity.
This wakes the display if it is off, and postpones display sleep according to the users system preferences This wakes the display if it is off, and postpones display sleep according to the users system preferences
...@@ -1405,7 +1405,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1405,7 +1405,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[[self mainMenu] setPause]; [[self mainMenu] setPause];
[o_mainwindow setPause]; [o_mainwindow setPause];
} else { } else {
if (state == END_S)
[o_mainmenu setSubmenusEnabled: FALSE]; [o_mainmenu setSubmenusEnabled: FALSE];
[[self mainMenu] setPlay]; [[self mainMenu] setPlay];
[o_mainwindow setPlay]; [o_mainwindow setPlay];
...@@ -1416,8 +1415,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1416,8 +1415,6 @@ static VLCMain *_o_sharedMainInstance = nil;
IOPMAssertionRelease(systemSleepAssertionID); IOPMAssertionRelease(systemSleepAssertionID);
} }
} }
vlc_object_release(p_input);
}
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateMainWindow) withObject: nil waitUntilDone: NO]; [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateMainWindow) withObject: nil waitUntilDone: NO];
[self performSelectorOnMainThread:@selector(sendDistributedNotificationWithUpdatedPlaybackStatus) withObject: nil waitUntilDone: NO]; [self performSelectorOnMainThread:@selector(sendDistributedNotificationWithUpdatedPlaybackStatus) withObject: nil waitUntilDone: NO];
......
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