Commit 0a7e31db authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

snapshot: remove redundant deadline check

vlc_cond_timedwait() returns non-zero when the deadline is reached.
parent a7ed2929
...@@ -78,15 +78,16 @@ void vout_snapshot_End(vout_snapshot_t *snap) ...@@ -78,15 +78,16 @@ void vout_snapshot_End(vout_snapshot_t *snap)
/* */ /* */
picture_t *vout_snapshot_Get(vout_snapshot_t *snap, mtime_t timeout) picture_t *vout_snapshot_Get(vout_snapshot_t *snap, mtime_t timeout)
{ {
const mtime_t deadline = mdate() + timeout;
vlc_mutex_lock(&snap->lock); vlc_mutex_lock(&snap->lock);
/* */ /* */
snap->request_count++; snap->request_count++;
/* */ /* */
const mtime_t deadline = mdate() + timeout; while (snap->is_available && !snap->picture &&
while (snap->is_available && !snap->picture && mdate() < deadline) vlc_cond_timedwait(&snap->wait, &snap->lock, deadline) == 0);
vlc_cond_timedwait(&snap->wait, &snap->lock, deadline);
/* */ /* */
picture_t *picture = snap->picture; picture_t *picture = snap->picture;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment