Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d7e5748f
Commit
d7e5748f
authored
Jun 20, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: hack to defer vout window creation is not needed anymore
parent
318f3eaa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
28 deletions
+5
-28
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+5
-28
No files found.
modules/gui/macosx/intf.m
View file @
d7e5748f
...
...
@@ -35,6 +35,7 @@
#include <stdlib.h>
/* malloc(), free() */
#include <string.h>
#include <vlc_common.h>
#include <vlc_atomic.h>
#include <vlc_keys.h>
#include <vlc_dialog.h>
#include <vlc_url.h>
...
...
@@ -99,9 +100,7 @@ static int BossCallback(vlc_object_t *, const char *,
#pragma mark -
#pragma mark VLC Interface Object Callbacks
static
bool
b_intf_starting
=
false
;
static
vlc_mutex_t
start_mutex
=
VLC_STATIC_MUTEX
;
static
vlc_cond_t
start_cond
=
VLC_STATIC_COND
;
static
atomic_bool
b_intf_starting
=
ATOMIC_VAR_INIT
(
false
);
static
NSLock
*
o_appLock
=
nil
;
// controls access to f_appExit
static
NSLock
*
o_vout_provider_lock
=
nil
;
...
...
@@ -125,16 +124,13 @@ int OpenIntf (vlc_object_t *p_this)
[[
VLCMain
sharedInstance
]
setIntf
:
p_intf
];
vlc_mutex_lock
(
&
start_mutex
);
b_intf_starting
=
true
;
vlc_cond_signal
(
&
start_cond
);
vlc_mutex_unlock
(
&
start_mutex
);
[
NSBundle
loadNibNamed
:
@"MainMenu"
owner
:
NSApp
];
[
NSBundle
loadNibNamed
:
@"MainWindow"
owner
:
[
VLCMain
sharedInstance
]];
[[[
VLCMain
sharedInstance
]
mainWindow
]
makeKeyAndOrderFront
:
nil
];
atomic_store
(
&
b_intf_starting
,
true
);
[
o_pool
release
];
return
VLC_SUCCESS
;
}
...
...
@@ -161,29 +157,10 @@ int WindowOpen(vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
msg_Dbg
(
p_wnd
,
"Opening video window"
);
/*
* HACK: Wait 200ms for the interface to come up.
* WindowOpen might be called before the mac intf is started. Lets wait until OpenIntf gets called
* and does basic initialization. Enqueuing the vout controller request into the main loop later on
* ensures that the actual window is created after the interface is fully initialized
* (applicationDidFinishLaunching).
*
* Timeout is needed as the mac intf is not always started at all.
*/
mtime_t
deadline
=
mdate
()
+
200000
;
vlc_mutex_lock
(
&
start_mutex
);
while
(
!
b_intf_starting
)
{
if
(
vlc_cond_timedwait
(
&
start_cond
,
&
start_mutex
,
deadline
))
{
break
;
// timeout
}
}
if
(
!
b_intf_starting
)
{
if
(
!
atomic_load
(
&
b_intf_starting
))
{
msg_Err
(
p_wnd
,
"Cannot create vout as Mac OS X interface was not found"
);
vlc_mutex_unlock
(
&
start_mutex
);
return
VLC_EGENERIC
;
}
vlc_mutex_unlock
(
&
start_mutex
);
NSAutoreleasePool
*
o_pool
=
[[
NSAutoreleasePool
alloc
]
init
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment