This bit of code would be much simpler with GMutexLocker: void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext* context, const IntRect& rect) { #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS) if (client()) return; #endif if (context->paintingDisabled() || m_skipPainting) return; if (!m_player->visible()) return; g_mutex_lock(m_bufferMutex); if (!m_buffer) { g_mutex_unlock(m_bufferMutex); return; } GRefPtr<GstCaps> caps = currentVideoSinkCaps(); if (!caps) { g_mutex_unlock(m_bufferMutex); return; } RefPtr<ImageGStreamer> gstImage = ImageGStreamer::createImage(m_buffer, caps.get()); if (!gstImage) { g_mutex_unlock(m_bufferMutex); return; } context->drawImage(reinterpret_cast<Image*>(gstImage->image().get()), ColorSpaceSRGB, rect, gstImage->rect(), CompositeCopy, ImageOrientationDescription(), false); g_mutex_unlock(m_bufferMutex); }
Created attachment 219180 [details] Patch
This just simplifies some code. There are two cases where it's not that much simpler, converting this: g_mutex_lock(...); something(); g_mutex_unlock(...); To this: { GMutexLocker lock(...); something(); } I decided to make that change anyway though, for consistency.
Comment on attachment 219180 [details] Patch Clearing flags on attachment: 219180 Committed r160593: <http://trac.webkit.org/changeset/160593>
All reviewed patches have been landed. Closing bug.