summaryrefslogtreecommitdiff
path: root/libavformat/ipmovie.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-04-17 23:36:57 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-17 23:43:54 +0200
commitc40798441f47341c310b38e8f329cfb943924faf (patch)
treec23fbec614c59bcf14c7377d1c6ff7abdfa34353 /libavformat/ipmovie.c
parentc96786008172f669e546ca987e7aaa3c3469be71 (diff)
parentfd0c3403f611d31b944216cfa1585a2d28f7f0da (diff)
Merge remote branch 'qatar/master'
* qatar/master: ac3dec: fix processing of delta bit allocation information. vc1: fix fate-vc1 after previous commit. wmv3dec: fix playback of complex WMV3 files using simple_idct. make av_dup_packet() more cautious on allocation failures make containers pass palette change in AVPacket introduce side information for AVPacket Politic commits that have not been pulled: Update regtest checksums after revision 6001dad. Replace more FFmpeg references by Libav. Replace references to ffmpeg-devel with libav-devel; fix roundup URL. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/ipmovie.c')
-rw-r--r--libavformat/ipmovie.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index 8ea59a3b08..921242f8f8 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -97,6 +97,8 @@ typedef struct IPMVEContext {
unsigned int video_width;
unsigned int video_height;
int64_t video_pts;
+ uint32_t palette[256];
+ int has_palette;
unsigned int audio_bits;
unsigned int audio_channels;
@@ -116,8 +118,6 @@ typedef struct IPMVEContext {
int64_t next_chunk_offset;
- AVPaletteControl palette_control;
-
} IPMVEContext;
static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
@@ -162,6 +162,17 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb,
if (av_new_packet(pkt, s->decode_map_chunk_size + s->video_chunk_size))
return CHUNK_NOMEM;
+ if (s->has_palette) {
+ uint8_t *pal;
+
+ pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
+ AVPALETTE_SIZE);
+ if (pal) {
+ memcpy(pal, s->palette, AVPALETTE_SIZE);
+ s->has_palette = 0;
+ }
+ }
+
pkt->pos= s->decode_map_chunk_offset;
avio_seek(pb, s->decode_map_chunk_offset, SEEK_SET);
s->decode_map_chunk_offset = 0;
@@ -456,10 +467,9 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
r = scratch[j++] * 4;
g = scratch[j++] * 4;
b = scratch[j++] * 4;
- s->palette_control.palette[i] = (r << 16) | (g << 8) | (b);
+ s->palette[i] = (r << 16) | (g << 8) | (b);
}
- /* indicate a palette change */
- s->palette_control.palette_changed = 1;
+ s->has_palette = 1;
break;
case OPCODE_SET_PALETTE_COMPRESSED:
@@ -573,9 +583,6 @@ static int ipmovie_read_header(AVFormatContext *s,
st->codec->height = ipmovie->video_height;
st->codec->bits_per_coded_sample = ipmovie->video_bpp;
- /* palette considerations */
- st->codec->palctrl = &ipmovie->palette_control;
-
if (ipmovie->audio_type) {
st = av_new_stream(s, 0);
if (!st)