[vlc-commits] omx: fix timeout handling
Rémi Denis-Courmont
git at videolan.org
Fri Jul 10 18:06:26 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Jul 10 19:06:20 2015 +0300| [6b19e7119565428c29c2ff98c4db13ad237cd648] | committer: Rémi Denis-Courmont
omx: fix timeout handling
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6b19e7119565428c29c2ff98c4db13ad237cd648
---
modules/codec/omxil/utils.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules/codec/omxil/utils.c b/modules/codec/omxil/utils.c
index 8263ad1..8cd00d4 100644
--- a/modules/codec/omxil/utils.c
+++ b/modules/codec/omxil/utils.c
@@ -81,13 +81,14 @@ OMX_ERRORTYPE WaitForOmxEvent(OmxEventQueue *queue, OMX_EVENTTYPE *event,
OMX_U32 *data_1, OMX_U32 *data_2, OMX_PTR *event_data)
{
OmxEvent *p_event;
+ mtime_t deadline = mdate() + CLOCK_FREQ;
vlc_mutex_lock(&queue->mutex);
- if(!queue->p_events)
- vlc_cond_timedwait(&queue->cond, &queue->mutex, mdate()+CLOCK_FREQ);
+ while ((p_event = queue->p_events) == NULL)
+ if (vlc_cond_timedwait(&queue->cond, &queue->mutex, deadline))
+ break;
- p_event = queue->p_events;
if(p_event)
{
queue->p_events = p_event->next;
More information about the vlc-commits
mailing list