From patchwork Sat Dec 30 21:13:16 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: 45396 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6623:b0:194:e134:edd4 with SMTP id n35csp5483438pzh; Sat, 30 Dec 2023 13:13:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFWa9gmHdJWOQZ4Qc/bHTioeQBL1BvDshuuSLUMRKJZWhP8pNqy4BcImUmUR5fjd3mla2b8 X-Received: by 2002:a05:6512:94f:b0:50e:4b42:7d7 with SMTP id u15-20020a056512094f00b0050e4b4207d7mr2383761lft.200.1703970806938; Sat, 30 Dec 2023 13:13:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703970806; cv=none; d=google.com; s=arc-20160816; b=UjIXYKk+waIyjuzYjMMA85/OMfn0MFxMvY7wusnDR+o6czsnvDjpxgwtcajO1L+Mb+ 2WUl4cG8E6tEp4IJxZydhD7YDgUyF8ziJ+jjP59FhM+iB9lXl8MC5HVSjDaJQp61AFFr 5v6BGnxhXvfGXtKt4W/7qNpyHS0FrxY3j5vQWlQLKopOERb2TgMKUcRvoW7bqIW2xTPx KxGyfPotq597/Xe2wRKNuf7T5jLSsbONY3on9VOwKY6IJTa/dfsVEnz3nf+CkPb9NKlk kDA/nn/EkHfN0FvqLz/4ijg6nvr/ImlunCxux+KYRzClbY/q581nY6p4rs7dUPobrql8 /uDg== 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:references:in-reply-to:date:to:from :message-id:delivered-to; bh=qzvYTiC2LtzcwLsU87amqmThI1YXVqLjHqVE1kzp7NU=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=gSEEehaKH23DYSK2/kqnfX/3L3GCOo8eQtPWnymSlIhprrXo21KWZtZFT/g9QECQGA op1JSsj1czy+y50Qfa/9lmrGpdZqO/2L5DSooOMGbQ6HCyrfTuIhfzoFB8FTQVN6xcis Ltw4SbrLTF9TGWmPzWuua/eDiLLhzS8uNd7ITNNGNieBl11L38Tb1QrbK7JVNn5gbDR5 SvXqeJnX6UZkMQbOnoIwmwCqU7L6XDS4NKGz/a9kBFjSCmy79ctNJaemMr88NTuwyk/b WY0mTto8Fedg3hLEuvO06RrHmq56fUaTuIkF694iA6rW9ehLHm0pY1++FXh2TDh1DymJ aM0g== 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 l18-20020a056402255200b0055333945e4bsi9321772edb.480.2023.12.30.13.13.26; Sat, 30 Dec 2023 13:13:26 -0800 (PST) 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 2FB6968CC70; Sat, 30 Dec 2023 23:13:24 +0200 (EET) 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 9996468BCEC for ; Sat, 30 Dec 2023 23:13:17 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by glom.nmugroup.com (Postfix) with ESMTP id 413C75428493 for ; Sat, 30 Dec 2023 22:13:17 +0100 (CET) Received: from debian.lan (unknown [IPv6:2a00:66c0:a::72c]) (Authenticated sender: git01) by glom.nmugroup.com (Postfix) with ESMTPSA id 003D45428441 for ; Sat, 30 Dec 2023 22:13:16 +0100 (CET) Message-ID: From: Tomas =?iso-8859-1?q?H=E4rdin?= To: FFmpeg development discussions and patches Date: Sat, 30 Dec 2023 22:13:16 +0100 In-Reply-To: References: User-Agent: Evolution 3.46.4-2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 2/6] lavf/apc: Read duration from file 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: l57m4HI4zpPH From 2ef5c89c3e3173b26690bad0279fd484a30a6268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= Date: Tue, 26 Dec 2023 14:31:59 +0100 Subject: [PATCH 2/6] lavf/apc: Read duration from file --- libavformat/apc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/apc.c b/libavformat/apc.c index b8b18c966c..7765c53088 100644 --- a/libavformat/apc.c +++ b/libavformat/apc.c @@ -24,6 +24,7 @@ #include "libavutil/channel_layout.h" #include "avformat.h" #include "demux.h" +#include "internal.h" static int apc_probe(const AVProbeData *p) { @@ -51,8 +52,9 @@ static int apc_read_header(AVFormatContext *s) st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = AV_CODEC_ID_ADPCM_IMA_APC; - avio_rl32(pb); /* number of samples */ + st->duration = avio_rl32(pb); /* number of samples */ st->codecpar->sample_rate = avio_rl32(pb); + avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); /* initial predictor values for adpcm decoder */ if ((ret = ff_get_extradata(s, st->codecpar, pb, 2 * 4)) < 0) -- 2.39.2