]> git.sesse.net Git - ffmpeg/commitdiff
Handle JPEG2000 frames stored in the Quicktime container.
authorJai Menon <jmenon86@gmail.com>
Tue, 10 Nov 2009 14:48:32 +0000 (14:48 +0000)
committerJai Menon <jmenon86@gmail.com>
Tue, 10 Nov 2009 14:48:32 +0000 (14:48 +0000)
Fixes issue 1525.

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

libavcodec/libopenjpeg.c

index 3a3a127327542c59de59e06d94456968813ee60c..f1e047437c547692be857c96c12fb1b3bd506420 100644 (file)
@@ -80,6 +80,10 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
        (AV_RB32(buf + 8) == JP2_SIG_VALUE)) {
         dec = opj_create_decompress(CODEC_JP2);
     } else {
+        // If the AVPacket contains a jp2c box, then skip to
+        // the starting byte of the codestream.
+        if (AV_RB32(buf + 4) == AV_RB32("jp2c"))
+            buf += 8;
         dec = opj_create_decompress(CODEC_J2K);
     }