mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 19:59:59 +01:00
BugFix Stream: ensure replacement of texture on re-open
This commit is contained in:
@@ -105,7 +105,7 @@ std::string Stream::decoderName()
|
||||
|
||||
guint Stream::texture() const
|
||||
{
|
||||
if (textureindex_ == 0)
|
||||
if (!textureindex_)
|
||||
return Resource::getTextureBlack();
|
||||
|
||||
return textureindex_;
|
||||
@@ -518,8 +518,9 @@ GstClockTime Stream::position()
|
||||
void Stream::init_texture(guint index)
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
if (textureindex_ < 1)
|
||||
glGenTextures(1, &textureindex_);
|
||||
if (textureindex_)
|
||||
glDeleteTextures(1, &textureindex_);
|
||||
glGenTextures(1, &textureindex_);
|
||||
glBindTexture(GL_TEXTURE_2D, textureindex_);
|
||||
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, width_, height_);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width_, height_,
|
||||
@@ -582,7 +583,7 @@ void Stream::init_texture(guint index)
|
||||
void Stream::fill_texture(guint index)
|
||||
{
|
||||
// is this the first frame ?
|
||||
if ( !textureinitialized_ || textureindex_ < 1)
|
||||
if ( !textureinitialized_ || !textureindex_)
|
||||
{
|
||||
// initialize texture
|
||||
init_texture(index);
|
||||
|
||||
Reference in New Issue
Block a user