mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Support FLIC in AVI.
Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e206b51fd3
commit
e4cc9f309e
@ -85,8 +85,9 @@ static av_cold int flic_decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
if (avctx->extradata_size != 0 &&
|
if (avctx->extradata_size != 0 &&
|
||||||
avctx->extradata_size != 12 &&
|
avctx->extradata_size != 12 &&
|
||||||
avctx->extradata_size != 128) {
|
avctx->extradata_size != 128 &&
|
||||||
av_log(avctx, AV_LOG_ERROR, "Expected extradata of 12 or 128 bytes\n");
|
avctx->extradata_size != 1024) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Expected extradata of 12, 128 or 1024 bytes\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,6 +97,15 @@ static av_cold int flic_decode_init(AVCodecContext *avctx)
|
|||||||
/* special case for magic carpet FLIs */
|
/* special case for magic carpet FLIs */
|
||||||
s->fli_type = FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE;
|
s->fli_type = FLC_MAGIC_CARPET_SYNTHETIC_TYPE_CODE;
|
||||||
depth = 8;
|
depth = 8;
|
||||||
|
} else if (avctx->extradata_size == 1024) {
|
||||||
|
uint8_t *ptr = avctx->extradata;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 256; i++) {
|
||||||
|
s->palette[i] = AV_RL32(ptr);
|
||||||
|
ptr += 4;
|
||||||
|
}
|
||||||
|
depth = 8;
|
||||||
} else if (avctx->extradata_size == 0) {
|
} else if (avctx->extradata_size == 0) {
|
||||||
/* FLI in MOV, see e.g. FFmpeg trac issue #626 */
|
/* FLI in MOV, see e.g. FFmpeg trac issue #626 */
|
||||||
s->fli_type = FLI_TYPE_CODE;
|
s->fli_type = FLI_TYPE_CODE;
|
||||||
@ -433,9 +443,8 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* by the end of the chunk, the stream ptr should equal the frame
|
/* by the end of the chunk, the stream ptr should equal the frame
|
||||||
* size (minus 1, possibly); if it doesn't, issue a warning */
|
* size (minus 1 or 2, possibly); if it doesn't, issue a warning */
|
||||||
if ((bytestream2_get_bytes_left(&g2) != 0) &&
|
if (bytestream2_get_bytes_left(&g2) > 2)
|
||||||
(bytestream2_get_bytes_left(&g2) != 1))
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "Processed FLI chunk where chunk size = %d " \
|
av_log(avctx, AV_LOG_ERROR, "Processed FLI chunk where chunk size = %d " \
|
||||||
"and final chunk ptr = %d\n", buf_size,
|
"and final chunk ptr = %d\n", buf_size,
|
||||||
buf_size - bytestream2_get_bytes_left(&g2));
|
buf_size - bytestream2_get_bytes_left(&g2));
|
||||||
|
@ -300,6 +300,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
|
|||||||
{ CODEC_ID_DXTORY, MKTAG('x', 't', 'o', 'r') },
|
{ CODEC_ID_DXTORY, MKTAG('x', 't', 'o', 'r') },
|
||||||
{ CODEC_ID_ZEROCODEC, MKTAG('Z', 'E', 'C', 'O') },
|
{ CODEC_ID_ZEROCODEC, MKTAG('Z', 'E', 'C', 'O') },
|
||||||
{ CODEC_ID_Y41P, MKTAG('Y', '4', '1', 'P') },
|
{ CODEC_ID_Y41P, MKTAG('Y', '4', '1', 'P') },
|
||||||
|
{ CODEC_ID_FLIC, MKTAG('A', 'F', 'L', 'C') },
|
||||||
{ CODEC_ID_NONE, 0 }
|
{ CODEC_ID_NONE, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user