From patchwork Thu Jun 20 04:50:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Zhao X-Patchwork-Id: 13640 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id B3FD74499BB for ; Thu, 20 Jun 2019 07:50:50 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9644D68A882; Thu, 20 Jun 2019 07:50:50 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D273468A7D8 for ; Thu, 20 Jun 2019 07:50:43 +0300 (EEST) Received: by mail-pl1-f195.google.com with SMTP id p1so869360plo.2 for ; Wed, 19 Jun 2019 21:50:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dVJGatD71reF1Da2ZLH5GTSw+WtkJyphNgT+VlzTeeU=; b=BQDS1wCEvoYZUpVu6gYukrNq4O0TzucYET0JVwUOVzO8ALmvgkbVUkU2dGNHafl7rt 4PEW0pZLVn0ik3Npk/kmMzaTWrlKJOx8NDafkhP66GI2Wx3RLfeOtj2pkuh5fRv++hfS A3D7gJRiFMdUAEdD6XdQEgPCM7b2MWGq+hhRGW/eVdKeJJT4/Edf9LBgFbXDigp4JLKa XB+kWMMmwnxKElUNG8g+wPvh+XEyPjpdKnAy0RbsvsNOXUdWBy5TPIgkx0B7LRDqAGkU gKsMMGCRPf5fkm0R9JfgOH7SpjkVMeMFB031jr6T8fY6Zon9atUpHysmLhSSjdQh2kYW /W6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dVJGatD71reF1Da2ZLH5GTSw+WtkJyphNgT+VlzTeeU=; b=MRLKuXoDMCDGlV/4UeZlQIdzkc/4F1lTdGC4N/kdxciHBOx9RsmSZfxK6lEXRJeuS1 wcGmO/STJ1gQRMRVSW+c46NRXJD5PeHjeojh8lKRd8YJTBsKcfBERp6ZeoUMNVcLixih KNnGQ6s+HRWLOTXd0nMspI7KnUK+cKR4ZDXdX5U8K6jFvF19kKOufUg/J/NVMejRg16i n1y/IFrNUTWFstvkm9knoUt0mnOdapniL31yi48NHiBYvb6Cf7glmE3zuV/amI5Rcx5N cI2o3y4uTjvkfiNgR08onQTaZMEC4XFER+3esZGbGG6EHUtSBtyW/LDbe0uJ6xIymnJ7 107w== X-Gm-Message-State: APjAAAXiq0cgfLcgmwVc2R3jGvqeNMBUBE8eKkXBSl0Ing7z6OzcjDgh U2hIw0s+8cYyrl9pnk2ywCn1Mbw9 X-Google-Smtp-Source: APXvYqxvSCESGhjqbKYJLePGFYMXx4YPtNqv6aeH/ZzvNbua7VTdMWyA10UcJjCpUxYZWTVnNTl5+g== X-Received: by 2002:a17:902:8f87:: with SMTP id z7mr95413766plo.65.1561006241922; Wed, 19 Jun 2019 21:50:41 -0700 (PDT) Received: from localhost.localdomain ([47.90.47.25]) by smtp.gmail.com with ESMTPSA id f3sm18831785pfg.165.2019.06.19.21.50.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jun 2019 21:50:41 -0700 (PDT) From: Jun Zhao To: ffmpeg-devel@ffmpeg.org Date: Thu, 20 Jun 2019 12:50:33 +0800 Message-Id: <1561006234-21948-2-git-send-email-mypopydev@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1561006234-21948-1-git-send-email-mypopydev@gmail.com> References: <1561006234-21948-1-git-send-email-mypopydev@gmail.com> Subject: [FFmpeg-devel] [PATCH V1 2/3] ffmpeg_opt: Respect default disposition when select audio/video X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Jun Zhao MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Jun Zhao Respect default disposition when select audio/video Signed-off-by: Jun Zhao --- fftools/ffmpeg_opt.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 53d688b..f5ca18a 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -2198,7 +2198,8 @@ static int open_output_file(OptionsContext *o, const char *filename) for (i = 0; i < nb_input_streams; i++) { int new_area; ist = input_streams[i]; - new_area = ist->st->codecpar->width * ist->st->codecpar->height + 100000000*!!ist->st->codec_info_nb_frames; + new_area = ist->st->codecpar->width * ist->st->codecpar->height + 100000000*!!ist->st->codec_info_nb_frames + + 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT); if (ist->user_set_discard == AVDISCARD_ALL) continue; if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)) @@ -2221,7 +2222,8 @@ static int open_output_file(OptionsContext *o, const char *filename) for (i = 0; i < nb_input_streams; i++) { int score; ist = input_streams[i]; - score = ist->st->codecpar->channels + 100000000*!!ist->st->codec_info_nb_frames; + score = ist->st->codecpar->channels + 100000000*!!ist->st->codec_info_nb_frames + + 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT); if (ist->user_set_discard == AVDISCARD_ALL) continue; if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&