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
|
guint Stream::texture() const
|
||||||
{
|
{
|
||||||
if (textureindex_ == 0)
|
if (!textureindex_)
|
||||||
return Resource::getTextureBlack();
|
return Resource::getTextureBlack();
|
||||||
|
|
||||||
return textureindex_;
|
return textureindex_;
|
||||||
@@ -518,7 +518,8 @@ GstClockTime Stream::position()
|
|||||||
void Stream::init_texture(guint index)
|
void Stream::init_texture(guint index)
|
||||||
{
|
{
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
if (textureindex_ < 1)
|
if (textureindex_)
|
||||||
|
glDeleteTextures(1, &textureindex_);
|
||||||
glGenTextures(1, &textureindex_);
|
glGenTextures(1, &textureindex_);
|
||||||
glBindTexture(GL_TEXTURE_2D, textureindex_);
|
glBindTexture(GL_TEXTURE_2D, textureindex_);
|
||||||
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, width_, height_);
|
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, width_, height_);
|
||||||
@@ -582,7 +583,7 @@ void Stream::init_texture(guint index)
|
|||||||
void Stream::fill_texture(guint index)
|
void Stream::fill_texture(guint index)
|
||||||
{
|
{
|
||||||
// is this the first frame ?
|
// is this the first frame ?
|
||||||
if ( !textureinitialized_ || textureindex_ < 1)
|
if ( !textureinitialized_ || !textureindex_)
|
||||||
{
|
{
|
||||||
// initialize texture
|
// initialize texture
|
||||||
init_texture(index);
|
init_texture(index);
|
||||||
|
|||||||
Reference in New Issue
Block a user