Originally sent to
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790931
Resending here on request of Debian maintainer.

Package: libav-tools
Version: 6:11.4-1~deb8u1
Severity: wishlist
Tags: upstream patch

I suggest to add a Content-Length header to the mpjpeg output. This
makes it easier to parse the output, rather than relying on the
fixed boundary which, though very unlikely, could also occur within
an image. Since the size information is readily available, it's a
trivial change (attached).
--- libav-0.8.17/libavformat/mpjpeg.c
+++ libav-0.8.17/libavformat/mpjpeg.c
@@ -38,7 +38,8 @@
 {
     uint8_t buf1[256];
 
-    snprintf(buf1, sizeof(buf1), "Content-type: image/jpeg\n\n");
+    snprintf(buf1, sizeof(buf1),
+             "Content-type: image/jpeg\nContent-length: %i\n\n", pkt->size);
     avio_write(s->pb, buf1, strlen(buf1));
     avio_write(s->pb, pkt->data, pkt->size);
 
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to