summaryrefslogtreecommitdiff
path: root/libavformat/ipmovie.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-08 01:29:15 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-08 03:34:22 +0100
commit757473831c3e1cc231fb985bcaed622d66fd6b2e (patch)
treed3c83c1e3726c24b91bf9970b06fd1a83921fff0 /libavformat/ipmovie.c
parenta407baba85c2999707868e975c98b5a9de50f46d (diff)
parentbadb195d139f15dc189dd3f78930c9cbfce89c24 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (29 commits) cabac: Move code only used within the CABAC test program into the test program. vp56: Drop unnecessary cabac.h #include. h264-test: Initialize AVCodecContext.av_class. build: Skip compiling network.h and rtsp.h if networking is not enabled. cosmetics: drop some pointless parentheses Disable annoying warning without changing behavior faq: Solutions for common problems with sample paths when running FATE. avcodec: attempt to clarify the CODEC_CAP_DELAY documentation avcodec: fix avcodec_encode_audio() documentation. FATE: xmv-demux test; exercise the XMV demuxer without decoding the perceptual codecs inside. vqf: recognize more metadata chunks FATE test: BMV demuxer and associated video and audio decoders. FATE: indeo4 video decoder test. FATE: update xxan-wc4 test to a sample with more code coverage. Change the recent h264_mp4toannexb bitstream filter test to output to an elementary stream rather than a program stream. g722enc: validate AVCodecContext.trellis g722enc: set frame_size, and also handle an odd number of input samples g722enc: split encoding into separate functions for trellis vs. no trellis mpegaudiodec: Use clearer pointer math tta: Fix returned error code at EOF ... Conflicts: libavcodec/h264.c libavcodec/indeo3.c libavcodec/interplayvideo.c libavcodec/ivi_common.c libavcodec/libxvidff.c libavcodec/mpegvideo.c libavcodec/ppc/mpegvideo_altivec.c libavcodec/tta.c libavcodec/utils.c libavfilter/vsrc_buffer.c libavformat/Makefile tests/fate/indeo.mak tests/ref/acodec/g722 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/ipmovie.c')
-rw-r--r--libavformat/ipmovie.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index 6ebafb6647..bf9e5c0dcf 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -89,6 +89,7 @@ typedef struct IPMVEContext {
int64_t video_pts;
uint32_t palette[256];
int has_palette;
+ int changed;
unsigned int audio_bits;
unsigned int audio_channels;
@@ -168,6 +169,10 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
}
}
+ if (s->changed) {
+ ff_add_param_change(pkt, 0, 0, 0, s->video_width, s->video_height);
+ s->changed = 0;
+ }
pkt->pos= s->decode_map_chunk_offset;
avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET);
s->decode_map_chunk_offset = 0;
@@ -223,6 +228,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
int first_color, last_color;
int audio_flags;
unsigned char r, g, b;
+ unsigned int width, height;
/* see if there are any pending packets */
chunk_type = load_ipmovie_packet(s, pb, pkt);
@@ -379,8 +385,16 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
chunk_type = CHUNK_BAD;
break;
}
- s->video_width = AV_RL16(&scratch[0]) * 8;
- s->video_height = AV_RL16(&scratch[2]) * 8;
+ width = AV_RL16(&scratch[0]) * 8;
+ height = AV_RL16(&scratch[2]) * 8;
+ if (width != s->video_width) {
+ s->video_width = width;
+ s->changed++;
+ }
+ if (height != s->video_height) {
+ s->video_height = height;
+ s->changed++;
+ }
if (opcode_version < 2 || !AV_RL16(&scratch[6])) {
s->video_bpp = 8;
} else {