Skip to content

Commit

Permalink
[nemo-qtmultimedia-plugins] use invalidateTexture() instead of glDele…
Browse files Browse the repository at this point in the history
…teTextures

It makes the code a bit cleaner but does not affect the functionality.
  • Loading branch information
Mohammed Hassan committed Sep 2, 2014
1 parent c1f374e commit 470f9d2
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/videotexturebackend/videotexturebackend.cpp
Expand Up @@ -135,9 +135,8 @@ GStreamerVideoTexture::~GStreamerVideoTexture()
{
releaseTexture();

if (m_textureId) {
glDeleteTextures(1, &m_textureId);
}
invalidateTexture();

if (m_sink) {
gst_object_unref(GST_OBJECT(m_sink));
}
Expand Down Expand Up @@ -220,10 +219,9 @@ bool GStreamerVideoTexture::updateTexture()

EGLImageKHR image;
if (!nemo_gst_video_texture_bind_frame(sink, &image)) {
if (m_textureId) {
glDeleteTextures(1, &m_textureId);
m_textureId = 0;
}

invalidateTexture();

nemo_gst_video_texture_release_frame(sink, NULL);
return false;
} else {
Expand Down Expand Up @@ -263,10 +261,7 @@ void GStreamerVideoTexture::releaseTexture()

nemo_gst_video_texture_unbind_frame(sink);

if (m_textureId) {
glDeleteTextures(1, &m_textureId);
m_textureId = 0;
}
invalidateTexture();

EGLSyncKHR sync = eglCreateSyncKHR(m_display, EGL_SYNC_FENCE_KHR, NULL);
nemo_gst_video_texture_release_frame(sink, sync);
Expand Down

0 comments on commit 470f9d2

Please sign in to comment.