diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index dfd396c..816102b 100644
|
a
|
b
|
typedef struct AVPanScan{
|
| 840 | 840 | |
| 841 | 841 | enum AVPacketSideDataType { |
| 842 | 842 | AV_PKT_DATA_PALETTE, |
| | 843 | AV_PKT_DATA_FRAME_SIZE, |
| 843 | 844 | }; |
| 844 | 845 | |
| 845 | 846 | typedef struct AVPacket { |
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index c8aa8bf..c91069e 100644
|
a
|
b
|
static int ipvideo_decode_frame(AVCodecContext *avctx,
|
| 1039 | 1039 | int buf_size = avpkt->size; |
| 1040 | 1040 | IpvideoContext *s = avctx->priv_data; |
| 1041 | 1041 | |
| | 1042 | const unsigned int *size = (unsigned int *)av_packet_get_side_data(avpkt, AV_PKT_DATA_FRAME_SIZE, NULL); |
| | 1043 | if (size) { |
| | 1044 | av_log(NULL, AV_LOG_ERROR, "%dx%d\n", size[0], size[1]); |
| | 1045 | avcodec_set_dimensions(avctx, size[0], size[1]); |
| | 1046 | s->decoding_map_size = avctx->width * avctx->height / (8 * 8 * 2); |
| | 1047 | } |
| 1042 | 1048 | /* compressed buffer needs to be large enough to at least hold an entire |
| 1043 | 1049 | * decoding map */ |
| 1044 | 1050 | if (buf_size < s->decoding_map_size) |
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index 562b19a..7b651aa 100644
|
a
|
b
|
typedef struct IPMVEContext {
|
| 88 | 88 | int64_t video_pts; |
| 89 | 89 | uint32_t palette[256]; |
| 90 | 90 | int has_palette; |
| | 91 | int changed; |
| 91 | 92 | |
| 92 | 93 | unsigned int audio_bits; |
| 93 | 94 | unsigned int audio_channels; |
| … |
… |
static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
|
| 162 | 163 | } |
| 163 | 164 | } |
| 164 | 165 | |
| | 166 | unsigned int *frame_size; |
| | 167 | if (s->changed) { |
| | 168 | frame_size = (unsigned int *)av_packet_new_side_data(pkt, AV_PKT_DATA_FRAME_SIZE, 2 * sizeof(unsigned int)); |
| | 169 | if (frame_size) { |
| | 170 | frame_size[0] = s->video_width; |
| | 171 | frame_size[1] = s->video_height; |
| | 172 | } |
| | 173 | s->changed = 0; |
| | 174 | } |
| 165 | 175 | pkt->pos= s->decode_map_chunk_offset; |
| 166 | 176 | avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET); |
| 167 | 177 | s->decode_map_chunk_offset = 0; |
| … |
… |
static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
|
| 217 | 227 | int first_color, last_color; |
| 218 | 228 | int audio_flags; |
| 219 | 229 | unsigned char r, g, b; |
| | 230 | unsigned int width, height; |
| 220 | 231 | |
| 221 | 232 | /* see if there are any pending packets */ |
| 222 | 233 | chunk_type = load_ipmovie_packet(s, pb, pkt); |
| … |
… |
static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
|
| 373 | 384 | chunk_type = CHUNK_BAD; |
| 374 | 385 | break; |
| 375 | 386 | } |
| 376 | | s->video_width = AV_RL16(&scratch[0]) * 8; |
| 377 | | s->video_height = AV_RL16(&scratch[2]) * 8; |
| | 387 | width = AV_RL16(&scratch[0]) * 8; |
| | 388 | height = AV_RL16(&scratch[2]) * 8; |
| | 389 | if (width != s->video_width) { |
| | 390 | s->video_width = width; |
| | 391 | s->changed++; |
| | 392 | } |
| | 393 | if (height != s->video_height) { |
| | 394 | s->video_height = height; |
| | 395 | s->changed++; |
| | 396 | } |
| 378 | 397 | if (opcode_version < 2 || !AV_RL16(&scratch[6])) { |
| 379 | 398 | s->video_bpp = 8; |
| 380 | 399 | } else { |