Browse code

Handle JPEG2000 frames stored in the Quicktime container. Fixes issue 1525.

Originally committed as revision 20500 to svn://svn.ffmpeg.org/ffmpeg/trunk

Jai Menon authored on 2009/11/10 23:48:32
Showing 1 changed files
... ...
@@ -80,6 +80,10 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
80 80
        (AV_RB32(buf + 8) == JP2_SIG_VALUE)) {
81 81
         dec = opj_create_decompress(CODEC_JP2);
82 82
     } else {
83
+        // If the AVPacket contains a jp2c box, then skip to
84
+        // the starting byte of the codestream.
85
+        if (AV_RB32(buf + 4) == AV_RB32("jp2c"))
86
+            buf += 8;
83 87
         dec = opj_create_decompress(CODEC_J2K);
84 88
     }
85 89