From 20dd25adc3595c60c7215504a4df9db64e17dabc Mon Sep 17 00:00:00 2001 From: Luca Abeni Date: Wed, 2 Aug 2006 09:48:05 +0000 Subject: [PATCH] Do not set the codec's pixel format in the format's write_header() Originally committed as revision 5887 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/gif.c | 6 ++++-- tests/regression.sh | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libavformat/gif.c b/libavformat/gif.c index bef98d3..f9a891f 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -339,8 +339,10 @@ static int gif_write_header(AVFormatContext *s) // rate = video_enc->time_base.den; } - /* XXX: is it allowed ? seems to work so far... */ - video_enc->pix_fmt = PIX_FMT_RGB24; + if (video_enc->pix_fmt != PIX_FMT_RGB24) { + av_log(s, AV_LOG_ERROR, "ERROR: gif only handles the rgb24 pixel format. Use -pix_fmt rgb24.\n"); + return AVERROR_IO; + } gif_image_write_header(pb, width, height, loop_count, NULL); diff --git a/tests/regression.sh b/tests/regression.sh index 9aa1563..1d8c337 100755 --- a/tests/regression.sh +++ b/tests/regression.sh @@ -691,7 +691,7 @@ do_ffmpeg_crc $file -f image2pipe -i $file # gif file=${outfile}libav.gif -do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file +do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -pix_fmt rgb24 $file #do_ffmpeg_crc $file -i $file # yuv4mpeg -- 2.7.4