Bug#790931: libav-tools: mpjpeg output: add Content-Length header

Sebastian Ramacher sramacher at debian.org
Fri Jul 3 16:18:48 UTC 2015


Hi Frank

On 2015-07-03 08:28:23, Frank Heckenbach wrote:
> 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:
> 
> --- 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);
>  
> 

Thanks for the patch. Could you please send it to libav-devel at libav.org? See
https://libav.org/developer.html#Submitting-patches for more details.

Cheers
-- 
Sebastian Ramacher
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20150703/e0ad16e8/attachment.sig>


More information about the pkg-multimedia-maintainers mailing list