From patchwork Thu Jun 8 11:22:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Tomas_H=C3=A4rdin?= X-Patchwork-Id: 42005 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c526:b0:117:ac03:c9de with SMTP id gm38csp306284pzb; Thu, 8 Jun 2023 04:22:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4sxcGkuSPHTMdAFesy+RfdXH1mn320DjWgOwFFOxkhaZ1lDZ1KHSVog7KKGo25clV7FSyb X-Received: by 2002:a17:907:7285:b0:978:90cc:bf79 with SMTP id dt5-20020a170907728500b0097890ccbf79mr1806319ejc.4.1686223347714; Thu, 08 Jun 2023 04:22:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686223347; cv=none; d=google.com; s=arc-20160816; b=mhjoDRyFqReo3E3bBTyaqCbDw7Zey67cnX6ZRNxXJMFpoOp4gsAmmG5wfv8YN63la9 PFuUqnZ+5qErt3zK0OA4KhmKS3Jwf9mnxyMzCnoVLhno0Mt4DjPrFkKLqMMCte0cTVbQ eG93clp+wxwZbzi9Idq5h8EGtd4qCdiLbJhG6KBWZhRi2hFvn5qp7hF9mGStNva5r5qL ImueNrzWFV6LEHbQYu7kCkQlkvaWQ37oi8MFymP2Vm7eeds14YPJ2JwBWTtYKFTW0aHp yo8xjhckIqAdr50Vu7jIv0ybGwLc6wxG4Ln5M2iTXJw3q8twbn7gulMu1Zv5kof1O3uo 471Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:user-agent:date:to:from:message-id:delivered-to; bh=YDffSjLVnRwb/PRMmRPBMtIouWkteK00PS95k4+2wSM=; b=GM+7y/1/w+2Jr6zW+xgCegosoxWysVpsUab8DbvcnYlJhi9Zhs66KKqzlH9oVRU/95 kSKw0jEkZ4fCRpYGaI+bthVy3ebUPt/oOJtnGDa0POZJ6zaHvwYO1+w7m/BsXvDNZV/5 FGGsVCjccPV90V/61E8LOFcKQgDbZPJUX+f/JdotKhW9G5wYV4sV0b0tqC8OVYNCDV2C sMn2L9ItPNR2/GMb8+uwC5WAgDS1uP3sjScqW++L74488CAUk0QFS57MgTnEURKWhZGU wnG/zlfTncCbKAITZHk/veDKgoqAQVuZV4j+z2Wyi+XXBX6Gk9C5y316sQwqPv26ktwD Budw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a10-20020a1709065f8a00b009788b2d539asi694399eju.299.2023.06.08.04.22.27; Thu, 08 Jun 2023 04:22:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5E60468C237; Thu, 8 Jun 2023 14:22:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from glom.nmugroup.com (glom.nmugroup.com [193.183.80.6]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B1FFE68BF65 for ; Thu, 8 Jun 2023 14:22:16 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by glom.nmugroup.com (Postfix) with ESMTP id CCE3C5428525 for ; Thu, 8 Jun 2023 13:22:15 +0200 (CEST) Received: from [192.168.68.126] (c90-129-229-110.bredband.tele2.se [90.129.229.110]) (Authenticated sender: git01) by glom.nmugroup.com (Postfix) with ESMTPSA id 9F1DA542853C for ; Thu, 8 Jun 2023 13:22:15 +0200 (CEST) Message-ID: <97f9c4e9b0d09796eecb50419217bed9b97a0d81.camel@haerdin.se> From: Tomas =?iso-8859-1?q?H=E4rdin?= To: ffmpeg-devel Date: Thu, 08 Jun 2023 13:22:14 +0200 User-Agent: Evolution 3.38.3-1+deb11u1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavc/riffenc: Fix msrle support on Windows 95 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 2zaRSA6Ti0Ko This is important for the GoldSrc community among others. /Tomas From c5c2d535b3e5dc94b063e13359e475e9ce18e1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= 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