Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Tomas Härdin" <git@haerdin.se>
To: ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH 1/2] lavc/riffenc: Fix msrle support on Windows 95
Date: Thu, 08 Jun 2023 13:22:14 +0200
Message-ID: <97f9c4e9b0d09796eecb50419217bed9b97a0d81.camel@haerdin.se> (raw)

[-- Attachment #1: Type: text/plain, Size: 66 bytes --]

This is important for the GoldSrc community among others.

/Tomas

[-- Attachment #2: 0001-lavc-riffenc-Fix-msrle-support-on-Windows-95.patch --]
[-- Type: text/x-patch, Size: 1522 bytes --]

From c5c2d535b3e5dc94b063e13359e475e9ce18e1b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <git@haerdin.se>
Date: Thu, 8 Jun 2023 11:55:28 +0200
Subject: [PATCH 1/2] lavc/riffenc: Fix msrle support on Windows 95

---
 libavformat/riffenc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
index 179b0f12cb..3325419b94 100644
--- a/libavformat/riffenc.c
+++ b/libavformat/riffenc.c
@@ -239,14 +239,16 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par,
     /* depth */
     avio_wl16(pb, par->bits_per_coded_sample ? par->bits_per_coded_sample : 24);
     /* compression type */
-    avio_wl32(pb, par->codec_tag);
+    // MSRLE compatibility with Media Player 3.1 and Windows 95
+    avio_wl32(pb, par->codec_id == AV_CODEC_ID_MSRLE ? 1 : par->codec_tag);
     avio_wl32(pb, (par->width * par->height * (par->bits_per_coded_sample ? par->bits_per_coded_sample : 24)+7) / 8);
     avio_wl32(pb, 0);
     avio_wl32(pb, 0);
     /* Number of color indices in the color table that are used.
      * A value of 0 means 2^biBitCount indices, but this doesn't work
      * with Windows Media Player and files containing xxpc chunks. */
-    avio_wl32(pb, pal_avi ? 1 << par->bits_per_coded_sample : 0);
+    // MSRLE on Windows 95 requires a zero here
+    avio_wl32(pb, pal_avi && par->codec_id != AV_CODEC_ID_MSRLE ? 1 << par->bits_per_coded_sample : 0);
     avio_wl32(pb, 0);
 
     if (!ignore_extradata) {
-- 
2.30.2


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

             reply	other threads:[~2023-06-08 11:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08 11:22 Tomas Härdin [this message]
2023-06-08 11:23 ` [FFmpeg-devel] [PATCH 2/2] lavc/msrleenc: Add msrle encoder Tomas Härdin
2023-06-10 18:34   ` Andreas Rheinhardt
2023-06-08 11:27 ` [FFmpeg-devel] [PATCH 1/2] lavc/riffenc: Fix msrle support on Windows 95 Paul B Mahol
2023-06-08 11:44   ` Tomas Härdin
2023-06-19 15:42     ` Leo Izen
2023-06-19 16:57       ` Tomas Härdin
2023-06-16 13:20 ` [FFmpeg-devel] [PATCH 3/3] Add Changelog entry Tomas Härdin
2023-06-20 12:38   ` Tomas Härdin
2023-06-19 12:26 ` [FFmpeg-devel] [PATCH 1/2] lavc/riffenc: Fix msrle support on Windows 95 Tomas Härdin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=97f9c4e9b0d09796eecb50419217bed9b97a0d81.camel@haerdin.se \
    --to=git@haerdin.se \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git