<html><head></head><body>Hi,<br><br>First, that's a rather dubious optimization. Compilers know how to inline a fixed-size memset(), and you end up with one more branch with this patch.<br><br>It doesn't make the code any clearer either.<br><br><div class="gmail_quote">Le 21 août 2020 10:19:24 GMT+02:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">It's only needed when the display has no dimension yet. The rest of the time<br>we fill all (4) fields of the vout_display_place_t structure.<hr> src/video_output/display.c | 4 +++-<br> 1 file changed, 3 insertions(+), 1 deletion(-)<br><br>diff --git a/src/video_output/display.c b/src/video_output/display.c<br>index 8fd444168d0..84284e8f41d 100644<br>--- a/src/video_output/display.c<br>+++ b/src/video_output/display.c<br>@@ -150,9 +150,11 @@ void vout_display_PlacePicture(vout_display_place_t *place,<br>     assert(cfg->window_props.width == 0 && cfg->window_props.height == 0);<br> <br>     /* */<br>-    memset(place, 0, sizeof(*place));<br>     if (cfg->display.width == 0 || cfg->display.height == 0)<br>+    {<br>+        *place = (vout_display_place_t) { 0 };<br>         return;<br>+    }<br> <br>     /* */<br>     unsigned display_width;</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>