summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Reufer <thomas@reufer.ch>2015-03-16 19:36:42 +0100
committerThomas Reufer <thomas@reufer.ch>2015-03-16 19:36:42 +0100
commitec274bbfabaab8fb306975ace7774c75c6d63461 (patch)
treec3549a178909c248b1cdbf63152371bb8d82efbd
parent0aaa2e239b824c6078700970f42510f23199f52d (diff)
downloadvdr-plugin-rpihddevice-ec274bbfabaab8fb306975ace7774c75c6d63461.tar.gz
vdr-plugin-rpihddevice-ec274bbfabaab8fb306975ace7774c75c6d63461.tar.bz2
fixed allocation check for pixmaps and cached OSD images
-rw-r--r--ovgosd.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/ovgosd.c b/ovgosd.c
index 57ebec9..ffaed15 100644
--- a/ovgosd.c
+++ b/ovgosd.c
@@ -1622,24 +1622,22 @@ public:
tOvgImageRef *imageRef = GetImageRef(imageHandle);
DoCmd(new cOvgCmdStoreImage(imageRef,
- image.Width(), image.Height(), argb));
+ image.Width(), image.Height(), argb), true);
- cTimeMs timer(1000);
+ cTimeMs timer(5000);
while (imageRef->used && imageRef->image == VG_INVALID_HANDLE
&& !timer.TimedOut())
- cCondWait::SleepMs(5);
+ cCondWait::SleepMs(2);
if (imageRef->image == VG_INVALID_HANDLE)
{
+ ELOG("failed to store OSD image! (%s)", timer.TimedOut() ?
+ "timed out" : "allocation failed");
DropImageData(imageHandle);
imageHandle = 0;
}
}
}
-
- if (!imageHandle)
- ELOG("failed to store OSD image!");
-
return imageHandle;
}
@@ -2278,11 +2276,11 @@ public:
#endif
// create pixel buffer and wait until command has been completed
cOvgRenderTarget *buffer = new cOvgRenderTarget(width, height);
- m_ovg->DoCmd(new cOvgCmdCreatePixelBuffer(buffer));
+ m_ovg->DoCmd(new cOvgCmdCreatePixelBuffer(buffer), true);
- cTimeMs timer(1000);
+ cTimeMs timer(5000);
while (!buffer->initialized && !timer.TimedOut())
- cCondWait::SleepMs(5);
+ cCondWait::SleepMs(2);
if (buffer->initialized && buffer->image != VG_INVALID_HANDLE)
{
@@ -2302,7 +2300,8 @@ public:
}
else
{
- ELOG("[OpenVG] failed to allocate pixmap buffer!");
+ ELOG("[OpenVG] failed to create pixmap! (%s)",
+ timer.TimedOut() ? "timed out" : "allocation failed");
m_ovg->DoCmd(new cOvgCmdDestroySurface(buffer));
}
return NULL;