[FFmpeg-devel] [PATCH]Set the rawvideo image size to 0 in the bitmapinfoheader
Carl Eugen Hoyos
cehoyos at ag.or.at
Mon Sep 29 09:38:48 CEST 2014
On Monday 29 September 2014 01:30:44 am Carl Eugen Hoyos wrote:
> Attached patch fixes ticket #1304: biSizeImage may be 0 for images with
> codec tag 0, if the size is set too small, WMP refuses to play the file.
Patch with changes to fate attached.
Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
index 2eb2ae1..9e30f64 100644
--- a/libavformat/riffenc.c
+++ b/libavformat/riffenc.c
@@ -224,7 +224,11 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
avio_wl16(pb, enc->bits_per_coded_sample ? enc->bits_per_coded_sample : 24);
/* compression type */
avio_wl32(pb, enc->codec_tag);
+ if (!enc->codec_tag) {
+ avio_wl32(pb, 0);
+ } else {
avio_wl32(pb, (enc->width * enc->height * (enc->bits_per_coded_sample ? enc->bits_per_coded_sample : 24)+7) / 8);
+ }
avio_wl32(pb, 0);
avio_wl32(pb, 0);
avio_wl32(pb, 0);
diff --git a/tests/ref/vsynth/vsynth1-rgb b/tests/ref/vsynth/vsynth1-rgb
index 5f43618..7e2cf74 100644
--- a/tests/ref/vsynth/vsynth1-rgb
+++ b/tests/ref/vsynth/vsynth1-rgb
@@ -1,4 +1,4 @@
-a955310c1ad92f967fc4e3d38dc0ef91 *tests/data/fate/vsynth1-rgb.avi
+abab8ccd745e91349f6031fbf21e2fa8 *tests/data/fate/vsynth1-rgb.avi
15213248 tests/data/fate/vsynth1-rgb.avi
93695a27c24a61105076ca7b1f010bbd *tests/data/fate/vsynth1-rgb.out.rawvideo
stddev: 3.42 PSNR: 37.44 MAXDIFF: 48 bytes: 7603200/ 7603200
diff --git a/tests/ref/vsynth/vsynth2-rgb b/tests/ref/vsynth/vsynth2-rgb
index f86c37c..60c8d66 100644
--- a/tests/ref/vsynth/vsynth2-rgb
+++ b/tests/ref/vsynth/vsynth2-rgb
@@ -1,4 +1,4 @@
-188bce319523a1c7d24103aab1ed1bda *tests/data/fate/vsynth2-rgb.avi
+397fe75248f5debbb801ae8d52014b75 *tests/data/fate/vsynth2-rgb.avi
15213248 tests/data/fate/vsynth2-rgb.avi
98d0e2854731472c5bf13d8638502d0a *tests/data/fate/vsynth2-rgb.out.rawvideo
stddev: 1.26 PSNR: 46.10 MAXDIFF: 13 bytes: 7603200/ 7603200
diff --git a/tests/ref/vsynth/vsynth3-rgb b/tests/ref/vsynth/vsynth3-rgb
index f407523..a3ecf56 100644
--- a/tests/ref/vsynth/vsynth3-rgb
+++ b/tests/ref/vsynth/vsynth3-rgb
@@ -1,4 +1,4 @@
-7b20b20734352d33b18b802513f5fc47 *tests/data/fate/vsynth3-rgb.avi
+f645b6839b2e8ad6e2e811a53edc2157 *tests/data/fate/vsynth3-rgb.avi
180248 tests/data/fate/vsynth3-rgb.avi
693aff10c094f8bd31693f74cf79d2b2 *tests/data/fate/vsynth3-rgb.out.rawvideo
stddev: 3.67 PSNR: 36.82 MAXDIFF: 43 bytes: 86700/ 86700
More information about the ffmpeg-devel
mailing list