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
baad7a59
Commit
baad7a59
authored
May 09, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xosd: do not use pf_run
parent
72fd19ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
15 deletions
+31
-15
modules/notify/xosd.c
modules/notify/xosd.c
+31
-15
No files found.
modules/notify/xosd.c
View file @
baad7a59
...
...
@@ -43,10 +43,11 @@
*****************************************************************************/
struct
intf_sys_t
{
xosd
*
p_osd
;
/* libxosd handle */
bool
b_need_update
;
/* Update display ? */
vlc_mutex_t
lock
;
/* lock for the condition variable */
vlc_cond_t
cond
;
/* condition variable to know when to update */
xosd
*
p_osd
;
/**< libxosd handle */
bool
b_need_update
;
/**< Update display ? */
vlc_mutex_t
lock
;
/**< state lock */
vlc_cond_t
cond
;
/**< update condition variable */
vlc_thread_t
thread
;
/**< interface thread handle */
};
#define MAX_LINE_LENGTH 256
...
...
@@ -56,8 +57,7 @@ struct intf_sys_t
*****************************************************************************/
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Run
(
intf_thread_t
*
);
static
void
*
Run
(
void
*
);
static
int
PlaylistNext
(
vlc_object_t
*
p_this
,
const
char
*
psz_variable
,
vlc_value_t
oval
,
vlc_value_t
nval
,
void
*
param
);
...
...
@@ -162,14 +162,24 @@ static int Open( vlc_object_t *p_this )
// Initialize mutex and condition variable before adding the callbacks
vlc_mutex_init
(
&
p_sys
->
lock
);
vlc_cond_init
(
&
p_sys
->
cond
);
p_sys
->
b_need_update
=
true
;
if
(
vlc_clone
(
&
p_sys
->
thread
,
VLC_THREAD_PRIORITY_LOW
,
Run
,
p_intf
)
)
goto
error
;
// Add the callbacks
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
var_AddCallback
(
p_playlist
,
"item-current"
,
PlaylistNext
,
p_this
);
var_AddCallback
(
p_playlist
,
"item-change"
,
PlaylistNext
,
p_this
);
p_sys
->
b_need_update
=
true
;
p_intf
->
pf_run
=
Run
;
p_intf
->
pf_run
=
NULL
;
return
VLC_SUCCESS
;
error:
xosd_destroy
(
p_sys
->
p_osd
);
vlc_cond_destroy
(
&
p_sys
->
cond
);
vlc_mutex_destroy
(
&
p_sys
->
lock
);
free
(
p_sys
);
return
VLC_ENOMEM
;
}
/*****************************************************************************
...
...
@@ -178,18 +188,23 @@ static int Open( vlc_object_t *p_this )
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
);
vlc_cancel
(
p_sys
->
thread
);
var_DelCallback
(
p_playlist
,
"item-current"
,
PlaylistNext
,
p_this
);
var_DelCallback
(
p_playlist
,
"item-change"
,
PlaylistNext
,
p_this
);
vlc_join
(
p_sys
->
thread
,
NULL
);
vlc_cond_destroy
(
&
p_sys
->
cond
);
vlc_mutex_destroy
(
&
p_sys
->
lock
);
/* Uninitialize library */
xosd_destroy
(
p_
intf
->
p_
sys
->
p_osd
);
xosd_destroy
(
p_sys
->
p_osd
);
/* Destroy structure */
vlc_cond_destroy
(
&
p_intf
->
p_sys
->
cond
);
vlc_mutex_destroy
(
&
p_intf
->
p_sys
->
lock
);
free
(
p_intf
->
p_sys
);
free
(
p_sys
);
}
/*****************************************************************************
...
...
@@ -197,14 +212,15 @@ static void Close( vlc_object_t *p_this )
*****************************************************************************
* This part of the interface runs in a separate thread
*****************************************************************************/
static
void
Run
(
intf_thread_t
*
p_intf
)
static
void
*
Run
(
void
*
data
)
{
intf_thread_t
*
p_intf
=
data
;
playlist_t
*
p_playlist
;
playlist_item_t
*
p_item
=
NULL
;
char
*
psz_display
=
NULL
;
int
cancel
=
vlc_savecancel
();
while
(
true
)
for
(
;;
)
{
// Wait for a signal
vlc_restorecancel
(
cancel
);
...
...
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