History

lavf/riffenc: Handle AV_PIX_FMT_MONOBLACK

Mats Peterson committed 10 years ago

Commit 3ba57bf1 parent 6eb40211 file · +6 −1Browse files

Unified · Split

libavformat/riffenc.c+6−1
@@ -241,9 +241,14 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, · 240 unmodified lines
241 avio_w8(pb, 0);241 avio_w8(pb, 0);
242 } else if (raw_pal_avi) {242 } else if (raw_pal_avi) {
243 int i;243 int i;
244 enum AVPixelFormat pix_fmt = enc->pix_fmt;
245 if (pix_fmt == AV_PIX_FMT_NONE && enc->bits_per_coded_sample == 1)
246 pix_fmt = AV_PIX_FMT_MONOWHITE;
244 for (i = 0; i < 1 << enc->bits_per_coded_sample; i++) {247 for (i = 0; i < 1 << enc->bits_per_coded_sample; i++) {
245 /* Initialize 1 bpp palette to black & white */248 /* Initialize 1 bpp palette to black & white */
246 if (!i && enc->bits_per_coded_sample == 1)249 if (i == 0 && pix_fmt == AV_PIX_FMT_MONOWHITE)
250 avio_wl32(pb, 0xffffff);
251 else if (i == 1 && pix_fmt == AV_PIX_FMT_MONOBLACK)
247 avio_wl32(pb, 0xffffff);252 avio_wl32(pb, 0xffffff);
248 else253 else
249 avio_wl32(pb, 0);254 avio_wl32(pb, 0);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t