From patchwork Sun Jul 31 21:51:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Anthony Lemieux X-Patchwork-Id: 37058 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1649:b0:8b:613a:194d with SMTP id no9csp2154562pzb; Sun, 31 Jul 2022 14:52:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vhjOkpmVIROqrLyCSIO5FA5MunQP3lxNDwtk5x0ZMyIwdcDV5DKVkONW833DJNZsx9EA4F X-Received: by 2002:a17:907:7347:b0:730:5e9:8160 with SMTP id dq7-20020a170907734700b0073005e98160mr10156105ejc.630.1659304361287; Sun, 31 Jul 2022 14:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659304361; cv=none; d=google.com; s=arc-20160816; b=qMw1J8RKg5ERg4JRtJIeKpUhYPFibVxqC4r+8TEpGu9mzs4UTjRkVBavWTLBV9If5N EhcKhQ9b6/EC6NdMkoBIpoIrPaI5jToxV3W1BtHOEavHVY//HZR4nQ0P2rrzF1UqrNGJ 59X/sM+SdmMadqmNnPDruCCGnb8HGJY6YPosxEPtqE8au0GNK7/ml/baSPg138x3LwSH EtNKov8LeqEAy8EIwmIxcVK2J57kWezNCuvozfIrj/RCD7rLBH5Y2DkFk3e0lO4d1C1w cBJLd+vOwifGfENtrx0YkRjTa5DEHdQ0yXdWlpK4t5Fa+yXoSu8uW9IFjqurvUtBX92C 05gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:delivered-to; bh=9zCbXpHXmd755OeulNl9APs93akbkNU9xfuPlY7hEj8=; b=Ge6YXKw+Ewg+vodjWL98Qie0za/6sfHhsiK6UozTmTnW99S+BtnI07Kq7DV54SBquT Qk8T7m2PCIu62paJp90Ub2l49L2H/DW1B6cSLN05/XIX0lPfN3iKhxAYuD2FLj4ipUh1 TuLj6WNxfIhoG3ShO/GUOI1MzMQxlhiJRUBNJ4hSxxkLzuja6AJod2uGMIumjputAFOl 6Ws8lnX4edfVTjxEIPVPWJjSqvNpedJJpwumaL2Va2pwvondnbENcK5bGylO4o2wRPMe 8hiWWZx04irofl5fBhBhS2r0aMy/SzVHc8B5zxeq68OYytHvtnRHyGmHPAdt2pKBLpQ/ rhXg== 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 ga22-20020a170906b85600b007301b3b8e11si7317777ejb.613.2022.07.31.14.52.41; Sun, 31 Jul 2022 14:52:41 -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 199D068B92F; Mon, 1 Aug 2022 00:52:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6CF0B68B92F for ; Mon, 1 Aug 2022 00:52:24 +0300 (EEST) Received: by mail-pl1-f171.google.com with SMTP id x23so223302pll.7 for ; Sun, 31 Jul 2022 14:52:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FwKvxwrA3NOseZ5HpVCRZiIp+AR0Ge1Jb7rvqD7EFTM=; b=SSVBLd/fqjz9zSG/jgfPwmvfeeCgnsCSVs/pKt1kiQWu0F3dUebibqO+L8/n1KiWw9 J8gNBFsnK1I9/9Qm3saq/wRWRgwJNgtFuDA4WbYTVSFjPS7/HkPZSMg2Y6cE7HHe2r3E ItYI6tV9D/HjX4w5oNN3eisPDYUdDJ6d3REZXf5lPpQgs0uIcQ++ijZJ0/TbSnKOU31E J8x9NpaOwyC3qIYyUTjs0HznaYXVZk2NBbeop7RnhqiyeYKS/kn9Nosc24IckwtXedYP w15j2xYVgS+SsMZ6+V2Y8Hxq9VoPaMxDeyeClt/o1oYv2MG8mn98TJSYq5agO184/x6B /9Dg== X-Gm-Message-State: ACgBeo1drC6AyS41NgnuQ0YvAAZFlnCqjJxVkdaEVC6AzPYsVK15YMQk oB8pMQfyUgkGCt2t8+LYffYLCaB3+jA= X-Received: by 2002:a17:90a:1d4f:b0:1f3:10f2:155c with SMTP id u15-20020a17090a1d4f00b001f310f2155cmr15817845pju.25.1659304342349; Sun, 31 Jul 2022 14:52:22 -0700 (PDT) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id o6-20020a17090a4b4600b001f239783e3dsm10079440pjl.34.2022.07.31.14.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jul 2022 14:52:22 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Sun, 31 Jul 2022 14:52:04 -0700 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Sun, 31 Jul 2022 14:51:57 -0700 Message-Id: <20220731215157.22022-2-pal@sandflow.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220731215157.22022-1-pal@sandflow.com> References: <20220731215157.22022-1-pal@sandflow.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v5 2/2] avformat/imfdec: preserve stream information 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 Cc: Pierre-Anthony Lemieux Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: jciQMlScSXP2 From: Pierre-Anthony Lemieux As discussed at https://trac.ffmpeg.org/ticket/9818, the IMF demuxer does not currently preserve stream information such as language in the case of audio streams. --- libavformat/imfdec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 71dfb26958..4cd6a56a09 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -579,12 +579,15 @@ static int set_context_streams_from_tracks(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "Could not create stream\n"); return AVERROR(ENOMEM); } - asset_stream->id = i; - ret = avcodec_parameters_copy(asset_stream->codecpar, first_resource_stream->codecpar); + + ret = ff_stream_params_copy(asset_stream, first_resource_stream); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Could not copy stream parameters\n"); return ret; } + + asset_stream->id = i; + asset_stream->nb_frames = 0; avpriv_set_pts_info(asset_stream, first_resource_stream->pts_wrap_bits, first_resource_stream->time_base.num,