From dc43e5190dc12ab3274cf7c6b4b1c373829bd088 Mon Sep 17 00:00:00 2001 From: Jay Freeman Date: Mon, 2 Jun 2008 09:38:57 +0000 Subject: Fixed an upstream bug in ffmpeg's MJPEG-A bitstream filter that kept it from working with the iPhone's hardware JPEG encoder. git-svn-id: http://svn.telesphoreo.org/trunk@298 514c082c-b64e-11dc-b46d-3d985efe055d --- data/ffmpeg_/mjpega.diff | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 data/ffmpeg_/mjpega.diff (limited to 'data/ffmpeg_/mjpega.diff') diff --git a/data/ffmpeg_/mjpega.diff b/data/ffmpeg_/mjpega.diff new file mode 100644 index 000000000..c82baa8d3 --- /dev/null +++ b/data/ffmpeg_/mjpega.diff @@ -0,0 +1,32 @@ +diff -ru ffmpeg-export-2008-05-20/libavcodec/mjpega_dump_header_bsf.c ffmpeg-export-2008-05-20+iPhone/libavcodec/mjpega_dump_header_bsf.c +--- ffmpeg-export-2008-05-20/libavcodec/mjpega_dump_header_bsf.c 2007-05-19 00:53:41.000000000 +0000 ++++ ffmpeg-export-2008-05-20+iPhone/libavcodec/mjpega_dump_header_bsf.c 2008-06-02 02:56:08.000000000 +0000 +@@ -56,15 +56,24 @@ + bytestream_put_be32(&poutbufp, buf_size + 44); /* pad field size */ + bytestream_put_be32(&poutbufp, 0); /* next ptr */ + ++ uint32_t dqt = 0, dht = 0, sof0 = 0; ++ + for (i = 0; i < buf_size - 1; i++) { + if (buf[i] == 0xff) { + switch (buf[i + 1]) { +- case DQT: /* quant off */ +- case DHT: /* huff off */ +- case SOF0: /* image off */ +- bytestream_put_be32(&poutbufp, i + 46); ++ case DQT: ++ dqt = i + 46; ++ break; ++ case DHT: ++ dht = i + 46; ++ break; ++ case SOF0: ++ sof0 = i + 46; + break; + case SOS: ++ bytestream_put_be32(&poutbufp, dqt); /* quant off */ ++ bytestream_put_be32(&poutbufp, dht); /* huff off */ ++ bytestream_put_be32(&poutbufp, sof0); /* image off */ + bytestream_put_be32(&poutbufp, i + 46); /* scan off */ + bytestream_put_be32(&poutbufp, i + 46 + AV_RB16(buf + i + 2)); /* data off */ + bytestream_put_buffer(&poutbufp, buf + 2, buf_size - 2); /* skip already written SOI */ -- cgit v1.2.3