mpjpeg: Write the Content-length
authorFrank Heckenbach <f.heckenbach@fh-soft.de>
Fri, 3 Jul 2015 22:48:47 +0000 (00:48 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Fri, 3 Jul 2015 22:51:03 +0000 (00:51 +0200)
libavformat/mpjpeg.c

index 6c469e0..1a78c32 100644 (file)
@@ -33,7 +33,10 @@ static int mpjpeg_write_header(AVFormatContext *s)
 
 static int mpjpeg_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    avio_printf(s->pb, "Content-type: image/jpeg\n\n");
+    avio_printf(s->pb,
+                "Content-length: %i\n"
+                "Content-type: image/jpeg\n\n",
+                pkt->size);
     avio_write(s->pb, pkt->data, pkt->size);
 
     avio_printf(s->pb, "\n--%s\n", BOUNDARY_TAG);