<p>Hi Adrian,</p>
<p>On 16/08/12 16:08, Adrien Maglo wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> vlc | branch: master | Adrien Maglo <magsoft@videolan.org> | Wed May 25 19:55:24 2016 +0200| [63337cab3bc1aa3391721372c27ded107767ea4c] | committer: Jean-Baptiste Kempf
OpenGL: draw 360° frames on a sphere or a cube
</code></pre>
</blockquote>
<h3 id="potential-division-by-zero">Potential division-by-zero?</h3>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> @@ -1217,6 +1529,25 @@ static void DrawWithShaders(vout_display_opengl_t *vgl,
orientationTransformMatrix(orientationMatrix, vgl->fmt.orientation);
+ if (vgl->fmt.projection_mode == PROJECTION_MODE_EQUIRECTANGULAR
+ || vgl->fmt.projection_mode == PROJECTION_MODE_CUBEMAP_LAYOUT_STANDARD)
+ {
+ float sar = vgl->fmt.i_visible_width / vgl->fmt.i_visible_height;
+ getProjectionMatrix(sar, projectionMatrix);
+ getViewMatrix(viewMatrix);
+ getYRotMatrix(vgl->f_teta, yRotMatrix);
+ getXRotMatrix(vgl->f_phi, xRotMatrix);
+ getZoomMatrix(vgl->f_zoom, zoomMatrix);
+ }</code></pre>
</blockquote>
<ul>
<li>Is <code>vgl->fmt.i_visible_height</code> really guaranteed to not be <code>0</code> at this stage?</li>
</ul>
<p>Certainly such value would not make a lot of sense, but I am not sure whether protection against it is present elsewhere, nor do I think there actually is something in the codebase stating the equivalent of <code>assert( x.i_visible_height != 0 )</code> (where <code>x</code> is <code>struct video_format_t</code>).</p>
<p>In other words; mostly asking out of curiosity because it caught my attention reading the diff.</p>