From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id EFB9A43DB4 for ; Thu, 11 Aug 2022 05:58:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 018FB68B8C8; Thu, 11 Aug 2022 08:57:51 +0300 (EEST) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9C47E68B7EB for ; Thu, 11 Aug 2022 08:57:44 +0300 (EEST) Received: by mail-pl1-f169.google.com with SMTP id z19so16144986plb.1 for ; Wed, 10 Aug 2022 22:57:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=gq6jei1+J599H3II8rkEZ0Id8tdW9lHrn5Hpa2S3bRI=; b=FVEOGFIVN2XW35JKmu5MhMquILrmz5B55iDKxYDQtZVwutFxuaz7dnbRXb6jJ8rvXk pxUPZ0EPiXqOoIfirnUrGqCw+IyYmPuhK5bhV8QuNg3RoBYPSDWSVKR8htROUp7zTKaB /3YPlln+/W5AfSCUJgJ0mB8aCFRghZl0/jxGy3Q9FEOAx6RzwMnMjFi01IJ7G7HwMf9z sDXkLTkvmNeIAWyBOdwQosnH2XJ7TeP2r89RXooZU/+omrfWnoDob0bt3ZOohE7OBYu3 rmUUhJ5/KzKhYtZxqGE9nZZeFmEQgpb2XZJOZMudHpRO1eLfb61eh5Wq2uaOZoS6kQw2 7rsQ== X-Gm-Message-State: ACgBeo1IHvP71beOjAL1RWLTdNDGrNZ5hlLyKFovuZIZYuojcGWLNg8F 40CavwgT+DyVxZKIVDP23RLOjlYUUcY= X-Google-Smtp-Source: AA6agR45b6fZFrj0Zd/yIECezZtCHiMxWEN9QRbkTnkamFHF8I7sPE5ktnDn7HaTqjGGcvuZ24eoww== X-Received: by 2002:a17:903:192:b0:16f:8a63:18ef with SMTP id z18-20020a170903019200b0016f8a6318efmr29408089plg.95.1660197462459; Wed, 10 Aug 2022 22:57:42 -0700 (PDT) Received: from localhost (76-14-89-2.sf-cable.astound.net. [76.14.89.2]) by smtp.gmail.com with ESMTPSA id m5-20020a170902768500b0016d4f05eb95sm13823386pll.272.2022.08.10.22.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 22:57:42 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Wed, 10 Aug 2022 22:57:39 -0700 From: pal@sandflow.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 10 Aug 2022 22:57:33 -0700 Message-Id: <20220811055733.8127-2-pal@sandflow.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220811055733.8127-1-pal@sandflow.com> References: <20220811055733.8127-1-pal@sandflow.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v8 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Pierre-Anthony Lemieux --- libavformat/imfdec.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 71dfb26958..5bbe7a53f8 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -573,18 +573,14 @@ static int set_context_streams_from_tracks(AVFormatContext *s) first_resource_stream = c->tracks[i]->resources[0].ctx->streams[0]; av_log(s, AV_LOG_DEBUG, "Open the first resource of track %d\n", c->tracks[i]->index); - /* Copy stream information */ - asset_stream = avformat_new_stream(s, NULL); + asset_stream = ff_stream_clone(s, first_resource_stream); if (!asset_stream) { - av_log(s, AV_LOG_ERROR, "Could not create stream\n"); + av_log(s, AV_LOG_ERROR, "Could not clone stream\n"); return AVERROR(ENOMEM); } + asset_stream->id = i; - ret = avcodec_parameters_copy(asset_stream->codecpar, first_resource_stream->codecpar); - if (ret < 0) { - av_log(s, AV_LOG_ERROR, "Could not copy stream parameters\n"); - return ret; - } + asset_stream->nb_frames = 0; avpriv_set_pts_info(asset_stream, first_resource_stream->pts_wrap_bits, first_resource_stream->time_base.num, -- 2.25.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".