From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 9866849FDD for ; Thu, 20 Nov 2025 21:33:05 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'hLGJpKS29ONbeXVc4mUCPVQD7+ZuBXdUcJuTcS6/qhs=', expected b'xHWW60bCg4KX6EuviFwa3I/xUsHf/cKEyQZtrCmRtzo=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1763674373; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=hLGJpKS29ONbeXVc4mUCPVQD7+ZuBXdUcJuTcS6/qhs=; b=B8DkH5FEr2YdQg2y0Ph2eVd4/45ADl7IohH5z3DXHdBEGqSGeok+nL9Q3tFXvmJ3MEK4j MBiqeRxeW7SAspO3u0F1ftHVR/e1cegQSa+3qsy7Lk2UnVCSjdBaTNE3mEeVBIhQYUGY3kP YGmIMyW4ZkMcQdFnSKwo8P9WOM3hPTFhVfXTyZ7ds49pTxk2EYAkzgHgZgPFREdzegg9zNm yLab+ypL1cWZ2H+3+xCOR4V4viVvke1OSP3DUhfMDO3vmcer8a4uDYW5PUN+xO92CvFezLW vlBS5Vv1vWa2LdMNRPQ9GRDrqltRpo+OwDHaOy28sfyAW+iJLRH8BzQYbhAg== Received: from [172.19.0.2] (unknown [172.19.0.2]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id CD9E768FFCC; Thu, 20 Nov 2025 23:32:53 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1763674371; b=PWkNp50vVz0zua09ZkCZ8y974sslAIeoXawBXvQD06n2LhfvT6Pfgx+sFZDHLTZYeFqB+ tETCPkrGHuJOZEUbIcd15IUAzATqgbZmRuZ8NZ0pUi4tUdU64jMHiDTubE9PErsuFYameNW qulnS7QZA88vf7FiGsTaD2JXxqmKzQJAoRdp6vpLTIx1Uu+KHfLaXOBqWbpSJpSeME/LXVl QBfBJoehHv8vdjLKycS6HjF1y/UUP4RnzxjYVkm1/9xfie4OzmGomwm7QGccdhsIVV4TSGh 61Naei62gcmW2ZitB0ANVeESFaygTXT+M1A83tNMvTkNq8U79MtTyaZgjSOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1763674371; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=oStQ6KUAl7t1Kx4TlYH7hqQwkyWEBgYmb3/5bEhLWFM=; b=j6kO9JnaiBEM6aoYbxnQs9oWV3d+0dubUUq1jdcfuxUy7ilv9Z2MP9qJG0pKbJBpmXkEp LysEAFt70/xQHfWXv1Tb/JtpSGefxhX+qpdqsp7M7Yu4JxFTXixt7b1UUK4CxQZdcpR8HjY nQuJg6yKRgEDMv/jrUUb3fUV4SVJg4PKknofwRa1UV8WfWMBjiCJ7X1yM+LEYHHgM1Wr/2M ENGGv2zOHfRJtxyjZffX6ezuPoILWx9ZD3e/wTmzmpzZVr2pn9pV24bzIYdQiDdhBnowJoC FZChXy07ucqkf3PRRgmxujn97d64SGrC+WD681rbjf66hxilwFg4ggIPKyhg== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1763674365; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=xHWW60bCg4KX6EuviFwa3I/xUsHf/cKEyQZtrCmRtzo=; b=qNtlVm8cgqpRiZOZ8RrtPPXcsQy/WNgn7ybvab9l7aOS28GIkbV6tyNhrKZYUS6Y7Hlw4 yFL+hRmZtr1AO9XKGB1nbk36CJVL2/MeMRouL/2DSJt1iHQH+inbUJT3GCRUSiRVIQdmB7W covDnwEvvgLHBEMNdSolGh8SZmEx3YktX0BFj4aj2SoINUB8VjpU1uRQsS1nBVEwrI8LgQ5 QcCxWUaEicN/S2PlnqtRoxlRvV3SMU7b6Fte9pmpnoXz7j1WGmlVkKUQcJbYMfYLs2rc0EA XkirWUjDBkAGaA1yPwLU55w6dtNQXZ/6ljgTWGvZUM2nK6b+RKYiNnqVgKZQ== Received: from 188d6d40ca7a (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 07D8968FFB9 for ; Thu, 20 Nov 2025 23:32:44 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Thu, 20 Nov 2025 21:32:44 -0000 Message-ID: <176367436518.59.8100985951632538316@2cb04c0e5124> Message-ID-Hash: OFOQMPQORWSXIXOBR2IB7IR4TCXDSS6L X-Message-ID-Hash: OFOQMPQORWSXIXOBR2IB7IR4TCXDSS6L X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avformat/xmv: Better handling of audio compressions relation to sample blocks (PR #20986) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: GXTX via ffmpeg-devel Cc: GXTX Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20986 opened by GXTX URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20986 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20986.patch Fixes #20983 I believe this is mostly correct, however, I did run into *another* file that fails to en/decode properly when compression is 1 and bitrate is 44100, specifically the Valve intro XMV found on Half-Life 2. This is odd because it has the same header info from a different file which is properly handled. HL2: Valve_Leader.xmv ``` Version: 4 Video Width: 280 Video Height: 1e0 Duration: 44ef # of audio tracks: 1 0: Compression: 1, Channels: 2, Sample Rate: ac44, BPS: 10, Flags: 0 ``` HL2: Demo_Attract.xmv ``` Version: 4 Video Width: 280 Video Height: 1e0 Duration: 1fad9 # of audio tracks: 1 0: Compression: 1, Channels: 2, Sample Rate: ac44, BPS: 10, Flags: 0 ``` In either case the changes here make FFmpeg's XMV en/decoder mostly functional. Let me know if I can provide any samples, etc. and I can obviously remove the `#if 0` block if requested. >>From 86bee2b7118224064b9e4df90956f7148fc45717 Mon Sep 17 00:00:00 2001 From: wutno Date: Thu, 20 Nov 2025 16:24:08 -0500 Subject: [PATCH] avformat/xmv: Better handling of audio compressions relation to sample blocks --- libavformat/xmv.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libavformat/xmv.c b/libavformat/xmv.c index ed59f7b85b..098b0df0f6 100644 --- a/libavformat/xmv.c +++ b/libavformat/xmv.c @@ -194,7 +194,10 @@ static int xmv_read_header(AVFormatContext *s) packet->sample_rate * packet->channels; packet->block_align = XMV_BLOCK_ALIGN_SIZE * packet->channels; - packet->block_samples = 64; + if (packet->compression == 1) + packet->block_samples = XMV_BLOCK_ALIGN_SIZE / packet->channels; + else + packet->block_samples = 64; packet->codec_id = ff_wav_codec_get_id(packet->compression, packet->bits_per_sample); @@ -202,6 +205,12 @@ static int xmv_read_header(AVFormatContext *s) packet->frame_size = 0; packet->block_count = 0; + +#if 0 + if (packet->compression == 1 && packet->sample_rate == 44100) { + av_log(s, AV_LOG_WARNING, "We may not be able to handle this properly...\n"); + } +#endif /* TODO: ADPCM'd 5.1 sound is encoded in three separate streams. * Those need to be interleaved to a proper 5.1 stream. */ @@ -340,7 +349,7 @@ static int xmv_process_packet_header(AVFormatContext *s) ast->codecpar->sample_rate = packet->sample_rate; ast->codecpar->bits_per_coded_sample = packet->bits_per_sample; ast->codecpar->bit_rate = packet->bit_rate; - ast->codecpar->block_align = 36 * packet->channels; + ast->codecpar->block_align = XMV_BLOCK_ALIGN_SIZE * packet->channels; avpriv_set_pts_info(ast, 32, packet->block_samples, packet->sample_rate); -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org