<div>Which version of libjpeg I should use? If I use libjpeg8, I receive this compile error:</div><div><br></div><div>&gt;mjpeg_encoder.c:178:13: error: static declaration of &#39;jpeg_mem_dest&#39; follows non-static declaration<br>

&gt;/usr/include/jpeglib.h:956:14: note: previous declaration of &#39;jpeg_mem_dest&#39; was here</div><div><br></div><div>Thanks.<br><br></div><br><div class="gmail_quote">2011/7/6 Christophe Fergeau <span dir="ltr">&lt;<a href="mailto:cfergeau@redhat.com" target="_blank">cfergeau@redhat.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Wed, Jul 06, 2011 at 01:04:24PM +0200, Alon Levy wrote:<br>
&gt; On Wed, Jul 06, 2011 at 12:32:53PM +0200, Christophe Fergeau wrote:<br>
&gt; &gt; It&#39;s not used when we use jpeg-turbo colorspaces, so it&#39;s better<br>
&gt; &gt; to allocate it when we know we&#39;ll need it rather than always<br>
&gt; &gt; allocating it even if it won&#39;t be used.<br>
&gt;<br>
&gt; Just one thing - you&#39;re turning an abort to a return FALSE. have you tested<br>
&gt; this? does it get handled correctly all the way up?<br>
<br>
</div>Nope, I haven&#39;t tested it extensively. However the only caller is<br>
red_send_stream_data which already had codepaths returning FALSE before the<br>
mjpeg refactoring, so I&#39;d rather assume that FALSE is correctly handled in<br>
layers above red_send_stream_data. This leaves checking if it&#39;s correctly<br>
handled in red_send_stream_data, and it was not ;) I&#39;ll squash the patch<br>
below in patch 7/9.<br>
<br>
Yaniv also asked about the purpose of that if (width &gt; 3*width) test which<br>
triggers the abort()/return FALSE. My understanding is that it checks for<br>
3*width overflowing MAX_UINT, I&#39;ll add a comment saying that as well before<br>
pushing.<br>
<br>
diff --git a/server/red_worker.c b/server/red_worker.c<br>
index 70346f8..b547433 100644<br>
--- a/server/red_worker.c<br>
+++ b/server/red_worker.c<br>
@@ -7294,9 +7294,11 @@ static inline int<br>
red_send_stream_data(DisplayChannel *display_channel,<br>
     }<br>
<br>
     outbuf_size = display_channel-&gt;send_data.stream_outbuf_size;<br>
-    mjpeg_encoder_start_frame(stream-&gt;mjpeg_encoder,<br>
     image-&gt;u.bitmap.format,<br>
-                              &amp;display_channel-&gt;send_data.stream_outbuf,<br>
-                              &amp;outbuf_size);<br>
+    if (!mjpeg_encoder_start_frame(stream-&gt;mjpeg_encoder,<br>
image-&gt;u.bitmap.format,<br>
+<br>
&amp;display_channel-&gt;send_data.stream_outbuf,<br>
+                                   &amp;outbuf_size)) {<br>
+        return FALSE;<br>
+    }<br>
     if (!encode_frame(worker, &amp;drawable-&gt;red_drawable-&gt;u.copy.src_area,<br>
                       &amp;image-&gt;u.bitmap, stream)) {<br>
         return FALSE;<br>
<font color="#888888"><br>
Christophe<br>
</font><br>_______________________________________________<br>
Spice-devel mailing list<br>
<a href="mailto:Spice-devel@lists.freedesktop.org" target="_blank">Spice-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
<br></blockquote></div><br>