Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
2b5eb318
Commit
2b5eb318
authored
May 07, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't reregister the same callbacks over and over again
parent
77bea349
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
modules/gui/ncurses.c
modules/gui/ncurses.c
+10
-7
No files found.
modules/gui/ncurses.c
View file @
2b5eb318
...
...
@@ -108,6 +108,10 @@ static void ManageSlider ( intf_thread_t * );
static
void
ReadDir
(
intf_thread_t
*
);
static
void
start_color_and_pairs
(
intf_thread_t
*
);
static
playlist_t
*
pl_Get
(
intf_thread_t
*
p_intf
)
{
return
p_intf
->
p_sys
->
p_playlist
;
}
/*****************************************************************************
* Module descriptor
...
...
@@ -180,6 +184,7 @@ struct pl_item_t
struct
intf_sys_t
{
input_thread_t
*
p_input
;
playlist_t
*
p_playlist
;
bool
b_color
;
bool
b_color_started
;
...
...
@@ -335,12 +340,8 @@ static void Close( vlc_object_t *p_this )
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
intf_sys_t
*
p_sys
=
p_intf
->
p_sys
;
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
int
i
;
var_DelCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
p_intf
);
var_DelCallback
(
p_playlist
,
"item-append"
,
PlaylistChanged
,
p_intf
);
PlaylistDestroy
(
p_intf
);
for
(
i
=
0
;
i
<
p_sys
->
i_dir_entries
;
i
++
)
...
...
@@ -384,6 +385,7 @@ static void Run( intf_thread_t *p_intf )
{
intf_sys_t
*
p_sys
=
p_intf
->
p_sys
;
playlist_t
*
p_playlist
=
pl_Yield
(
p_intf
);
p_sys
->
p_playlist
=
p_playlist
;
int
i_key
;
time_t
t_last_refresh
;
...
...
@@ -396,15 +398,14 @@ static void Run( intf_thread_t *p_intf )
* force building of the playlist array
*/
PlaylistRebuild
(
p_intf
);
var_AddCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
p_intf
);
var_AddCallback
(
p_playlist
,
"item-append"
,
PlaylistChanged
,
p_intf
);
while
(
!
intf_ShouldDie
(
p_intf
)
)
{
msleep
(
INTF_IDLE_SLEEP
);
/* Update the input */
var_AddCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
p_intf
);
var_AddCallback
(
p_playlist
,
"item-append"
,
PlaylistChanged
,
p_intf
);
PL_LOCK
;
if
(
p_sys
->
p_input
==
NULL
)
{
...
...
@@ -458,6 +459,8 @@ static void Run( intf_thread_t *p_intf )
Redraw
(
p_intf
,
&
t_last_refresh
);
}
}
var_DelCallback
(
p_playlist
,
"intf-change"
,
PlaylistChanged
,
p_intf
);
var_DelCallback
(
p_playlist
,
"item-append"
,
PlaylistChanged
,
p_intf
);
}
/* following functions are local */
...
...
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