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
425d6074
Commit
425d6074
authored
May 31, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_object_timedwait: same change as vlc_object_wait
Also fix a minor timing problem in the screensaver plugin.
parent
cb56da1c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
27 deletions
+20
-27
modules/misc/audioscrobbler.c
modules/misc/audioscrobbler.c
+11
-15
modules/misc/screensaver.c
modules/misc/screensaver.c
+6
-3
src/misc/objects.c
src/misc/objects.c
+3
-9
No files found.
modules/misc/audioscrobbler.c
View file @
425d6074
...
...
@@ -274,25 +274,21 @@ static void Run( intf_thread_t *p_intf )
bool
b_die
=
false
,
b_wait
=
false
;
vlc_object_lock
(
p_intf
);
if
(
vlc_object_alive
(
p_intf
)
)
if
(
!
vlc_object_alive
(
p_intf
)
)
{
vlc_object_unlock
(
p_intf
);
msg_Dbg
(
p_intf
,
"audioscrobbler is dying"
);
return
;
}
if
(
mdate
()
<
p_sys
->
next_exchange
)
/* wait until we can resubmit, i.e. */
b_wait
=
!
vlc_object_timedwait
(
p_intf
,
p_sys
->
next_exchange
);
b_wait
=
vlc_object_timedwait
(
p_intf
,
p_sys
->
next_exchange
)
==
0
;
else
/* wait for data to submit */
/* we are signaled each time there is a song to submit */
vlc_object_wait
(
p_intf
);
}
b_die
=
!
vlc_object_alive
(
p_intf
);
vlc_object_unlock
(
p_intf
);
if
(
b_die
)
{
msg_Dbg
(
p_intf
,
"audioscrobbler is dying"
);
return
;
}
if
(
b_wait
)
continue
;
/* holding on until next_exchange */
...
...
modules/misc/screensaver.c
View file @
425d6074
...
...
@@ -176,8 +176,9 @@ static void Execute( intf_thread_t *p_this, const char *const *ppsz_args )
*****************************************************************************/
static
void
Run
(
intf_thread_t
*
p_intf
)
{
vlc_object_lock
(
p_intf
);
mtime_t
deadline
=
mdate
(
);
vlc_object_lock
(
p_intf
);
#ifdef HAVE_DBUS
p_intf
->
p_sys
->
p_connection
=
dbus_init
(
p_intf
);
#endif
...
...
@@ -186,8 +187,7 @@ static void Run( intf_thread_t *p_intf )
{
vlc_object_t
*
p_vout
;
/* Check screensaver every 30 seconds */
if
(
vlc_object_timedwait
(
p_intf
,
mdate
()
+
30000000
)
<
0
)
if
(
vlc_object_timedwait
(
p_intf
,
deadline
)
==
0
)
continue
;
p_vout
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_VOUT
,
FIND_ANYWHERE
);
...
...
@@ -222,6 +222,9 @@ static void Run( intf_thread_t *p_intf )
vlc_object_release
(
p_input
);
}
}
/* Check screensaver every 30 seconds */
refresh
=
mdate
()
+
30000000
;
}
vlc_object_unlock
(
p_intf
);
}
...
...
src/misc/objects.c
View file @
425d6074
...
...
@@ -545,19 +545,13 @@ void __vlc_object_wait( vlc_object_t *obj )
* Waits for the object to be signaled (using vlc_object_signal()), or for
* a timer to expire. It is asserted that the caller holds the object lock.
*
* @return negative if the object is dying and should terminate,
* positive if the the object has been signaled but is not dying,
* 0 if timeout has been reached.
* @return 0 if the object was signaled before the timer expiration, or
* ETIMEDOUT if the timer expired without any signal.
*/
int
__vlc_object_timedwait
(
vlc_object_t
*
obj
,
mtime_t
deadline
)
{
int
v
;
vlc_assert_locked
(
&
obj
->
object_lock
);
v
=
vlc_cond_timedwait
(
&
obj
->
object_wait
,
&
obj
->
object_lock
,
deadline
);
if
(
v
==
0
)
/* signaled */
return
obj
->
b_die
?
-
1
:
1
;
return
0
;
return
vlc_cond_timedwait
(
&
obj
->
object_wait
,
&
obj
->
object_lock
,
deadline
);
}
...
...
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