From: Bjorn Roche <bj...@xowave.com> --- libavcodec/gif.c | 14 +++++--------- libavformat/gif.c | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/libavcodec/gif.c b/libavcodec/gif.c index 3838aa7592..3ced6d4d45 100644 --- a/libavcodec/gif.c +++ b/libavcodec/gif.c @@ -265,7 +265,7 @@ static int gif_image_write_translucent(AVCodecContext *avctx, int x_end = w - 1, y_end = h - 1; - // top + // crop top while (y_start < y_end) { int i; int is_trans = 1; @@ -280,7 +280,7 @@ static int gif_image_write_translucent(AVCodecContext *avctx, ++y_start; } - // bottom + // crop bottom while (y_end < h) { int i; int is_trans = 1; @@ -295,7 +295,7 @@ static int gif_image_write_translucent(AVCodecContext *avctx, --y_end; } - // left + // crop left while (x_start < x_end) { int i; int is_trans = 1; @@ -310,7 +310,7 @@ static int gif_image_write_translucent(AVCodecContext *avctx, ++x_start; } - // right + // crop right while (x_end < w) { int i; int is_trans = 1; @@ -326,15 +326,11 @@ static int gif_image_write_translucent(AVCodecContext *avctx, } height = y_end + 1 - y_start; - width = x_end + 1 - x_start; + width = x_end + 1 - x_start; av_log(avctx, AV_LOG_DEBUG,"%dx%d image at pos (%d;%d) [area:%dx%d]\n", width, height, x_start, y_start, avctx->width, avctx->height); } - // for( int i=0; i<avctx->width*avctx->height; ++i ) { - // ((uint8_t *)buf)[i] = 120; - // } - uint8_t *frame_disposal = av_packet_new_side_data(pkt, AV_PKT_DATA_GIF_FRAME_DISPOSAL, 1); if (!frame_disposal) diff --git a/libavformat/gif.c b/libavformat/gif.c index 853e84430e..4662720049 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -176,7 +176,7 @@ static int flush_packet(AVFormatContext *s, AVPacket *new) } else { packed = 1<<2 | (bcid >= 0); } - //FIXME: if disposal == 2, make sure backgrdoun color is specified appropriately. + avio_w8(pb, 0x21); avio_w8(pb, 0xf9); avio_w8(pb, 0x04); /* block size */ -- 2.14.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel