diff options
author | Josep Torra <n770galaxy@gmail.com> | 2013-03-01 15:27:37 +0100 |
---|---|---|
committer | Josep Torra <n770galaxy@gmail.com> | 2013-03-01 15:27:37 +0100 |
commit | e1d69f255635eef2e551c25a36c901c49b47f1e8 (patch) | |
tree | 633d5fae0af282ae9aefe346c96826d75c9161a9 | |
parent | 215eebdcd1f7587c75a4c7f4c55e784425ebf3c4 (diff) |
omxvideodec: implement same kind of wait that it's in master
-rw-r--r-- | omx/gstomxvideodec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 89051b8..fe5813b 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -1645,9 +1645,12 @@ gst_omx_video_dec_drain (GstOMXVideoDec * self, gboolean is_eos) GST_DEBUG_OBJECT (self, "Waiting until component is drained"); if (G_UNLIKELY (self->dec->hacks & GST_OMX_HACK_DRAIN_MAY_NOT_RETURN)) { - GTimeVal tv = {.tv_sec = 0,.tv_usec = 500000 }; + GTimeVal timeval; - if (!g_cond_timed_wait (self->drain_cond, self->drain_lock, &tv)) + g_get_current_time (&timeval); + g_time_val_add (&timeval, (G_USEC_PER_SEC / 2)); + + if (!g_cond_timed_wait (self->drain_cond, self->drain_lock, &timeval)) GST_WARNING_OBJECT (self, "Drain timed out"); else GST_DEBUG_OBJECT (self, "Drained component"); |