From patchwork Tue Jul 12 22:34:13 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: 36765 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:6da0:b0:8b:e47:9dbf with SMTP id wl32csp2313083pzb; Tue, 12 Jul 2022 15:34:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1veyoiM4tCGxv/wFReEFUDJkKj79v5fLrcpiumapNEeW2h7jp7dPBNxZFNxhyQT/XjuP5Er X-Received: by 2002:a17:907:6d86:b0:72b:5ad6:6df1 with SMTP id sb6-20020a1709076d8600b0072b5ad66df1mr385355ejc.264.1657665293274; Tue, 12 Jul 2022 15:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657665293; cv=none; d=google.com; s=arc-20160816; b=dSNDxGBS3ZV84H75wkeyBkRkXz/EexzFlxEgjLMokeR50elWq7WLSkwRUX8BzlkUNG aKmsHrt3Nps9XnoTJy9a3M/5yfVcQ/1o0bRwPLHSmIJvG49yheGMpehAD+/pdW8ZCVfj gvhSbo6l/NzMEIilgmiPyRFe+UY5L3HvFePqjz/dK3dWjXxI+w5VRg2vetTzu/Px6w2D s8OJqX8itpEGmFVsWuFEQJ9RmV3rZcAH9Y/WHhdLwOWYBt8XcwfxwRiw8Y6xvpMoI9yU MyDYUmy2kxGM7KnioxiD6kzFeqH6o77uVRRPfPieIIKhAjy+CdPviwWQoSe/Y15Cqh+i sbwg== 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=puCszPIrfPRfPAsxGqMV+4sWLR+uMm0RYXypc45GqjOzyKXP8aF83RGWI9bfaRUq81 EQVH8yLOrl3Arpf5ld3I0Nrfu/+VaDY2u2uPQAJVSvkJNVY51tn3spfrjfWkIAVXHeO9 Ivtfax0MvBFKzD+M0hNPwXXDs2bwksZIA7lqWFgy+GyOldvlrV4nRHrHavllpFkHlcfT xxgnAgwf4pMXY0V1LBpED852h4U8IdWtrb7Qp0fwC6TQainshyHbfc3xisAnk778sndA IaiXnPE/X4sjn8RflC1dTqYS8WFCdQ+GgPzenx/HMKbusLk5qIJOdHhyzi8ipJ8DYI5Y 4+dA== 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 o27-20020a170906359b00b00711f4c750basi12657273ejb.940.2022.07.12.15.34.52; Tue, 12 Jul 2022 15:34:53 -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 892F868B864; Wed, 13 Jul 2022 01:34:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1712268B7F0 for ; Wed, 13 Jul 2022 01:34:34 +0300 (EEST) Received: by mail-pj1-f50.google.com with SMTP id fz10so9442035pjb.2 for ; Tue, 12 Jul 2022 15:34:34 -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=eX5WBQ1QtQB6VHFVEProLPO9CBCI9UurShpZdWueFmT0kkMBw18DayZTqvJp0Hpn08 SEetqbZctQjUn/c+nI5vDOdhmMWd6+JBM3godYFEOef417tRtidxY+kG3/YB4KWv3kWh /gQh9+zcbtziLksZetfPh0enFj3k/b6Cnru4O07M5UQ8gzvWPDMvRrsQGYqSDppYDJfh vjMeRABPwrKl32drRW/MG23iVeNhPS0y/XFzsa3Lz9o1b++JolFWOdSVZ2E6tzLdwCmT ZvQOPninyh/wK+i8AT2pevzAmUsvX80F+8mlbl/UxeN/5TChCrzjLazmM47+xXOI6y5F rs0w== X-Gm-Message-State: AJIora+s+98GX8D02aa8dN5RC+dyIy4V4k2aIBOJBB/cUaTtYFXfMwAi zoiagPBPSFlT+35CEnHJyS9McTQpY4Mgng== X-Received: by 2002:a17:902:ed02:b0:16b:d5f6:2c17 with SMTP id b2-20020a170902ed0200b0016bd5f62c17mr430664pld.85.1657665272060; Tue, 12 Jul 2022 15:34:32 -0700 (PDT) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id c2-20020a170902d48200b0016bc947c5b7sm7379639plg.38.2022.07.12.15.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 15:34:31 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Tue, 12 Jul 2022 15:34:25 -0700 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 12 Jul 2022 15:34:13 -0700 Message-Id: <20220712223413.29940-2-pal@sandflow.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220712223413.29940-1-pal@sandflow.com> References: <20220712223413.29940-1-pal@sandflow.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 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: ZkHqSDV5ETmV 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,