Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-05-16 23:39:03 +0300
committerPaul B Mahol <onemda@gmail.com>2016-05-16 23:39:03 +0300
commit72e33eec3a5e6d04d891e89ef0ab9d42054a6271 (patch)
treeeafdee7ed87043a0bda6c0bfc967cef10e8838ec /libavformat/iff.c
parent8767470fb572f394104d24acffb70eea9ce48ad3 (diff)
avcodec/iff: add support for ANIMs with keyframes and concatenated ANIMs
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/iff.c')
-rw-r--r--libavformat/iff.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c
index f3db2820a5..275710b892 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -834,20 +834,27 @@ static int iff_read_packet(AVFormatContext *s,
} else if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
st->codecpar->codec_tag == ID_ANIM) {
uint64_t data_size, orig_pos;
- uint32_t chunk_id = 0;
+ uint32_t chunk_id, chunk_id2;
while (!avio_feof(pb)) {
if (avio_feof(pb))
return AVERROR_EOF;
+ orig_pos = avio_tell(pb);
chunk_id = avio_rl32(pb);
data_size = avio_rb32(pb);
- orig_pos = avio_tell(pb);
+ chunk_id2 = avio_rl32(pb);
- if (chunk_id == ID_FORM)
+ if (chunk_id == ID_FORM &&
+ chunk_id2 == ID_ILBM) {
+ avio_skip(pb, -4);
break;
- else
+ } else if (chunk_id == ID_FORM &&
+ chunk_id2 == ID_ANIM) {
+ continue;
+ } else {
avio_skip(pb, data_size);
+ }
}
ret = av_get_packet(pb, pkt, data_size);
pkt->pos = orig_pos;