diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-04-18 02:17:58 +0400 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-04-18 02:24:25 +0400 |
commit | dfb323109c6218e46d71d07583a2643e973190b1 (patch) | |
tree | 4088fcf9160ae75531ffdba5b4a3de2d426ee263 /libavformat | |
parent | 7b972d82b673c55ba0593ec1433af97f491154c4 (diff) |
lavf/gif: simplify palette writing.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/gif.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libavformat/gif.c b/libavformat/gif.c index 7be2d1c35e..4a1d3ef298 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -55,7 +55,6 @@ static int gif_image_write_header(AVIOContext *pb, int width, int height, int loop_count, uint32_t *palette) { int i; - unsigned int v; avio_write(pb, "GIF", 3); avio_write(pb, "89a", 3); @@ -67,10 +66,8 @@ static int gif_image_write_header(AVIOContext *pb, int width, int height, avio_w8(pb, 0x1f); /* background color index */ avio_w8(pb, 0); /* aspect ratio */ for (i = 0; i < 256; i++) { - v = palette[i]; - avio_w8(pb, (v >> 16) & 0xff); - avio_w8(pb, (v >> 8) & 0xff); - avio_w8(pb, (v) & 0xff); + const uint32_t v = palette[i]; + avio_wb24(pb, v); } } else { avio_w8(pb, 0); /* flags */ |