diff options
| author | Thomas Reufer <thomas@reufer.ch> | 2015-03-16 19:36:42 +0100 |
|---|---|---|
| committer | Thomas Reufer <thomas@reufer.ch> | 2015-03-16 19:36:42 +0100 |
| commit | ec274bbfabaab8fb306975ace7774c75c6d63461 (patch) | |
| tree | c3549a178909c248b1cdbf63152371bb8d82efbd | |
| parent | 0aaa2e239b824c6078700970f42510f23199f52d (diff) | |
| download | vdr-plugin-rpihddevice-ec274bbfabaab8fb306975ace7774c75c6d63461.tar.gz vdr-plugin-rpihddevice-ec274bbfabaab8fb306975ace7774c75c6d63461.tar.bz2 | |
fixed allocation check for pixmaps and cached OSD images
| -rw-r--r-- | ovgosd.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -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; |
