Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
2a03eff7
Commit
2a03eff7
authored
Mar 04, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hotkeys control: Don't yield vout and input more than needed.
parent
6f7987fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
51 deletions
+30
-51
modules/control/hotkeys.c
modules/control/hotkeys.c
+30
-51
No files found.
modules/control/hotkeys.c
View file @
2a03eff7
...
...
@@ -112,9 +112,6 @@ static int Open( vlc_object_t *p_this )
p_intf
->
p_sys
->
i_size
=
0
;
p_intf
->
pf_run
=
Run
;
p_intf
->
p_sys
->
p_input
=
NULL
;
p_intf
->
p_sys
->
p_vout
=
NULL
;
var_AddCallback
(
p_intf
->
p_libvlc
,
"key-pressed"
,
KeyEvent
,
p_intf
);
return
VLC_SUCCESS
;
}
...
...
@@ -127,14 +124,7 @@ static void Close( vlc_object_t *p_this )
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
var_DelCallback
(
p_intf
->
p_libvlc
,
"key-pressed"
,
KeyEvent
,
p_intf
);
if
(
p_intf
->
p_sys
->
p_input
)
{
vlc_object_release
(
p_intf
->
p_sys
->
p_input
);
}
if
(
p_intf
->
p_sys
->
p_vout
)
{
vlc_object_release
(
p_intf
->
p_sys
->
p_vout
);
}
vlc_mutex_destroy
(
&
p_intf
->
p_sys
->
change_lock
);
/* Destroy structure */
free
(
p_intf
->
p_sys
);
...
...
@@ -173,46 +163,6 @@ static void Run( intf_thread_t *p_intf )
/* Sleep a bit */
// msleep( INTF_IDLE_SLEEP );
/* Update the input */
if
(
p_intf
->
p_sys
->
p_input
==
NULL
)
{
PL_LOCK
;
p_intf
->
p_sys
->
p_input
=
p_playlist
->
p_input
;
if
(
p_intf
->
p_sys
->
p_input
)
vlc_object_yield
(
p_intf
->
p_sys
->
p_input
);
PL_UNLOCK
;
}
else
if
(
p_intf
->
p_sys
->
p_input
->
b_dead
)
{
vlc_object_release
(
p_intf
->
p_sys
->
p_input
);
p_intf
->
p_sys
->
p_input
=
NULL
;
}
p_input
=
p_intf
->
p_sys
->
p_input
;
/* Update the vout */
p_last_vout
=
p_intf
->
p_sys
->
p_vout
;
if
(
p_vout
==
NULL
)
{
p_vout
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
p_intf
->
p_sys
->
p_vout
=
p_vout
;
}
else
if
(
p_vout
->
b_die
)
{
vlc_object_release
(
p_vout
);
p_vout
=
NULL
;
p_intf
->
p_sys
->
p_vout
=
NULL
;
}
/* Register OSD channels */
if
(
p_vout
&&
p_vout
!=
p_last_vout
)
{
for
(
i
=
0
;
i
<
CHANNELS_NUMBER
;
i
++
)
{
spu_Control
(
p_vout
->
p_spu
,
SPU_CHANNEL_REGISTER
,
&
p_intf
->
p_sys
->
p_channels
[
i
]
);
}
}
/* Find action triggered by hotkey */
i_action
=
0
;
i_key
=
GetKey
(
p_intf
);
...
...
@@ -237,11 +187,36 @@ static void Run( intf_thread_t *p_intf )
continue
;
}
/* Update the input */
PL_LOCK
;
p_input
=
p_playlist
->
p_input
;
if
(
p_input
)
vlc_object_yield
(
p_input
);
PL_UNLOCK
;
/* Update the vout */
p_last_vout
=
p_vout
;
p_vout
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
/* Register OSD channels */
if
(
p_vout
&&
p_vout
!=
p_last_vout
)
{
for
(
i
=
0
;
i
<
CHANNELS_NUMBER
;
i
++
)
{
spu_Control
(
p_vout
->
p_spu
,
SPU_CHANNEL_REGISTER
,
&
p_intf
->
p_sys
->
p_channels
[
i
]
);
}
}
if
(
i_action
==
ACTIONID_QUIT
)
{
p_intf
->
p_libvlc
->
b_die
=
VLC_TRUE
;
ClearChannels
(
p_intf
,
p_vout
);
vout_OSDMessage
(
p_intf
,
DEFAULT_CHAN
,
_
(
"Quit"
)
);
if
(
p_vout
)
vlc_object_release
(
p_vout
);
if
(
p_input
)
vlc_object_release
(
p_input
);
continue
;
}
else
if
(
i_action
==
ACTIONID_VOL_UP
)
...
...
@@ -738,6 +713,10 @@ static void Run( intf_thread_t *p_intf )
}
}
}
if
(
p_vout
)
vlc_object_release
(
p_vout
);
if
(
p_input
)
vlc_object_release
(
p_input
);
}
pl_Release
(
p_intf
);
}
...
...
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