Skip to content

Commit

Permalink
gl: fix texture effective width change detection
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Jun 19, 2016
1 parent 6bfebf1 commit 41a4550
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/opengl/VideoShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ void VideoMaterial::setCurrentFrame(const VideoFrame &frame)
if (t == QByteArrayLiteral("rect"))
new_target = GL_TEXTURE_RECTANGLE;
if (new_target != d.target) {
qDebug("texture target: %#x=>%#x", d.target, new_target);
// FIXME: not thread safe (in qml)
d.target = new_target;
d.init_textures_required = true;
Expand Down Expand Up @@ -1048,7 +1049,7 @@ bool VideoMaterialPrivate::ensureResources()
// effective size may change even if plane size not changed
bool effective_tex_width_ratio_changed = true;
for (int i = 0; i < nb_planes; ++i) {
if ((qreal)frame.effectiveBytesPerLine(0)/(qreal)frame.bytesPerLine(0) == effective_tex_width_ratio) {
if ((qreal)frame.effectiveBytesPerLine(i)/(qreal)frame.bytesPerLine(i) == effective_tex_width_ratio) {
effective_tex_width_ratio_changed = false;
break;
}
Expand Down

0 comments on commit 41a4550

Please sign in to comment.