Mercurial > libavcodec.hg
comparison libopenjpeg.c @ 10508:f33404f82b9e libavcodec
Handle JPEG2000 frames stored in the Quicktime container.
Fixes issue 1525.
author | jai_menon |
---|---|
date | Tue, 10 Nov 2009 14:48:32 +0000 |
parents | ca71c924b65f |
children | adf750125dc9 |
comparison
equal
deleted
inserted
replaced
10507:ca71c924b65f | 10508:f33404f82b9e |
---|---|
78 if((AV_RB32(buf) == 12) && | 78 if((AV_RB32(buf) == 12) && |
79 (AV_RB32(buf + 4) == JP2_SIG_TYPE) && | 79 (AV_RB32(buf + 4) == JP2_SIG_TYPE) && |
80 (AV_RB32(buf + 8) == JP2_SIG_VALUE)) { | 80 (AV_RB32(buf + 8) == JP2_SIG_VALUE)) { |
81 dec = opj_create_decompress(CODEC_JP2); | 81 dec = opj_create_decompress(CODEC_JP2); |
82 } else { | 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 dec = opj_create_decompress(CODEC_J2K); | 87 dec = opj_create_decompress(CODEC_J2K); |
84 } | 88 } |
85 | 89 |
86 if(!dec) { | 90 if(!dec) { |
87 av_log(avctx, AV_LOG_ERROR, "Error initializing decoder.\n"); | 91 av_log(avctx, AV_LOG_ERROR, "Error initializing decoder.\n"); |