From patchwork Tue Oct 18 11:51:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38774 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp2063268pzb; Tue, 18 Oct 2022 04:52:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4APEW/wpD5lyAHSW+uQZrp6zBH6vDJINJu5OOWk65NtFEpc3Ee5wFTX/LR1UG4j5GDTsMC X-Received: by 2002:a05:6402:401e:b0:45c:a1ce:94bf with SMTP id d30-20020a056402401e00b0045ca1ce94bfmr2196058eda.177.1666093942837; Tue, 18 Oct 2022 04:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666093942; cv=none; d=google.com; s=arc-20160816; b=r+7z9jUCID/5ds59PNEY0TSmMFuk+Gai+8Jq28q5mAGmY/v7ye+VLsXgSNNwFEnU+W CVZMF1YqcwrZxoCL7daTU6wQhfLMn/iRGO+NbWWHAdYPppdsysueRo2D0iIwxcTCLlLz mTWoiHvoB5EfJ+zZFjmvhKSS5mq/xz2in1vrmg5mpDU8Z/n2JoLiLyqo+C0yr1XoIIjE RcVUYR0NZRPtsjj0BHVedCsPneg1ZkQoyqflHTYLpcSFUGBg+wBxHDisG/NFb/AYvjkf 5M8nnfz8jf6+M/yyLj6dL2kBvB8RCmCva0r5SLzqs5jD5x3BEOZwJmmLLim5ebRbG7y5 3szw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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=vUBXyzrFhJKFNTD+0audQWLN4RyQvydHVBO5+91Ry1A=; b=npxhOFsD0NCvW7hV8+TYIBCYFzx7Zh6sFluLunIeUlq9KLTn5CMnRBuphVACoOKukU FNvBf/kvEBck6fKOUHP2ofaauu8+eqRkDmIq5e4gyqSbrQKJBOtKcHuU66qLVs8vMUi6 ZDCRrXKXvd8uWAHyuSh95+//1wv1d4rjzAloGwWe3GDHm4esHnSyXZ2IKQ8UikCFLkf/ ULrtI3QOICG01OThDdTdMR0tMr/A9V9BqvWr7tlfex6VqWxuxr04lLr5BDvBqdBezzLA VD16kfYV7K24NKgASW2D5HGy+ITcE2HNLgKgJEda9CeXWL44x+UCZSwT7EglTGA0hKPY ULRg== 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 e3-20020a17090658c300b0073d5a794b43si12404750ejs.985.2022.10.18.04.52.22; Tue, 18 Oct 2022 04:52:22 -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 2D9B568BD00; Tue, 18 Oct 2022 14:52:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1124668BB29 for ; Tue, 18 Oct 2022 14:52:11 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 3D2FD2400F4 for ; Tue, 18 Oct 2022 13:52:10 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id yS2FJLAw3OWh for ; Tue, 18 Oct 2022 13:52:09 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id C84442404E4 for ; Tue, 18 Oct 2022 13:52:09 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 7CB833A0922 for ; Tue, 18 Oct 2022 13:52:03 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 18 Oct 2022 13:51:58 +0200 Message-Id: <20221018115159.17780-2-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221018115159.17780-1-anton@khirnov.net> References: <20221018115159.17780-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] tools/decode_simple: initialize decoder parameters with container info 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: zF00Ae6yUOgQ --- tools/decode_simple.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/decode_simple.c b/tools/decode_simple.c index 8dc3bd2054..cd81d53168 100644 --- a/tools/decode_simple.c +++ b/tools/decode_simple.c @@ -149,6 +149,10 @@ int ds_open(DecodeContext *dc, const char *url, int stream_idx) if (!dc->decoder) return AVERROR(ENOMEM); + ret = avcodec_parameters_to_context(dc->decoder, dc->stream->codecpar); + if (ret < 0) + goto fail; + return 0; fail: