From patchwork Tue Nov 9 18:01:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31346 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp1496640iob; Tue, 9 Nov 2021 10:05:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzL3HVV8iERD8zFIraKDgYaxGS4heH3avHIhGQhOTke2ho8PHHDevXDsEqtmzeMlXZiA55d X-Received: by 2002:a05:6402:520b:: with SMTP id s11mr12649554edd.363.1636481129345; Tue, 09 Nov 2021 10:05:29 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dr4si17581772ejc.671.2021.11.09.10.05.28; Tue, 09 Nov 2021 10:05:29 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=KSLd8TfX; arc=fail (body hash mismatch); 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6632868ACAB; Tue, 9 Nov 2021 20:03:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2031.outbound.protection.outlook.com [40.92.90.31]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C8EC868AE7A for ; Tue, 9 Nov 2021 20:03:09 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FD1621dMjqVllFGUSyI1FyuZYGCFyAjCz9CB3lZja2h7NsvikXIRMT/a6xSbK27ZcZMEmA5cwChA7MIq2GbJKxXj16K3om/L/uJD2j55Ay0biHlLShC/AfZ4FUWNvEZyziyaqFeiW/bi1kqRC3RD2h8bZvjspCCnniZa7FcI93te3IUivlHwvsI+AcKIt2CYKr5r98KGxBIlJzIhpm/y4aBOrP2wl6d4zd09VOSypZoVFhnDlwFwY75Nhhv/BcrOP7Et1a4op3WgM7P3FlDf15nBX8+tU2OYmKQ2+z9USD5X5a5LtJ9cMI5Mr+5+kYVZyG2ecMLRQoe0GuFdEBFQkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I5gk/72vi8dhLXt/60J8YWoCeCX7f4QAmaNwsHpqXAY=; b=MMQLVUwptFT8EmC/OdIQjyrO8ynM4XgG3zXyXMLFDPh2dmMQ9fcEwNiXFffg1jN+6w3dsrJYL0ghQ2Rv0IScWpfFnOT8vwYJZRyxm5TexIspDwiT+WOy01vIogNg0fD9L4mvZKPmDHTsJ7RjAvqDvbduOM7DPOjTsOkDdE7bThICkFWm0OX8Shb7IrR7rlN7JbS1uaAdH/9o8q0Z7cfF3SivO0J2OISx50tTUNG/aEesJNZV+Y6Hi9EY7ff2/ejwMUaT8/Jkj7wK+6je57xqfA5anFd2z0BUJ09fWhXaPNUBOewlIFjU23hTBOjpErsqCFIUosaglybvC8H0nO8Bvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I5gk/72vi8dhLXt/60J8YWoCeCX7f4QAmaNwsHpqXAY=; b=KSLd8TfXLyS+Urgh+NBhhsQ4sQUlIgI/ddtDqEvckjBfDQTMaEQNNE3KDrmrZEiBV6YS1CRwNRko4dg0JNKINux5gxXsm4zPH9QA2U3tQLRw+vkolwy07+kJczCfy2qCdy/XgtzNFxfjBRtJJMjATsQZ0pviuZIwBM869/FUm3sTDdFhmxmitepuCQWs+05yU13xnZWlYB9h/ppMRQSVuPxKtwz6gNscKjBDa75sN3U+Uet9TeBkaiRDUnT5d9+krlUnb7RgvEZ3VJ+vgWXFvi/6hr9ZRohzSkOZclhLOpbFiqnifzVomIaSg9NaC+/b1G7dlBsbcyXjqu8EdQBgTg== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM5PR03MB2929.eurprd03.prod.outlook.com (2603:10a6:206:1c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Tue, 9 Nov 2021 18:03:08 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%8]) with mapi id 15.20.4669.016; Tue, 9 Nov 2021 18:03:08 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 9 Nov 2021 19:01:55 +0100 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [KaSxOyK57HFGPGMPVE2cw3z1t5ryh1SU] X-ClientProxiedBy: FR0P281CA0081.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::7) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211109180155.881111-16-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.171.90) by FR0P281CA0081.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.5 via Frontend Transport; Tue, 9 Nov 2021 18:03:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 689b8449-d221-4174-5dcd-08d9a3ab2f6f X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRIlshE2JAC11E3nazVg9SyK10yXtOTXmPOsiH9NMO9NEPq/WU3rmCz3lvm0OrdOmdbyN82Ednjboh3ffVbZXBrmVyzUgms0pavcmSLyKqwRFLOWwfF/pXEeiv5VEYlip0nKJCcb1eK1NtfmE79cfOBkMAblZx+1f4dw5k5wDj/t55FKiIyiLF921cmZspjWgKYJue4NNw3giexV4oOaj5wG4JEwibytDLXrNbW9nxlkHcWlir01BXxnZIbb/MLkiNENHKwNAXCO7rNoJAOmvGfuXKYkLmTdxAgbGZTAnGRye2FfX5OoEufBae6fcwJq1t3ZKVolKgNxa2F5FfyilIAtOesUJA4sm8Ocfb9qU+p0rde1RrncDzBk2C7uJmMFPqHU+ynbB2QCulq4xGHwx6AiBWT6vbOxgOVWKmLEMJi+U+FrNNOD8t5/l9l0tjRFtsRVnksaknTr2NuPbxueWcjuQd/OFPfh2+gSwT8Oe6SowMs6j0EoXkNJ32iTPSEATBU9pedVzRG91GueargYDYdUjCWSm/KVzYCD+2Uz7uIIstaRB75/LuGyDJyvYLO2wJheju1ll/aSvQ3R/gsM7uqtnkpU+t/wa933srFuXh5TBBvX3VGsMOQ+/e3MVHOYw/g3MqvJa53VfYTnzOLUsnSK0vGxFCXbspkTbcYseP+ITDfhHt/RWnJ5NPxb6ZcCoQ86C4Qe4MR4sC4Sjxc/04SrGuogvh85mhTydVHDRG6yQFmhCwmSyviXRGWsw22fpk= X-MS-TrafficTypeDiagnostic: AM5PR03MB2929: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 65GLiG/OioGHd2HorLwQvYZQ4YCWaJkAeB0oTKBze2PG9RrZbnzDKYnd0wziMBipREBX30rYvQE9h/cXOMeFYqdRY8o2QJwZZnEjEpDeFwv7hiMvdNQuWpgQ78a5i410C4Gn/T3XdJzcy2s1r8LCLbfiDCa5V1OBv9QxElZduoOhU31yRa3kZV7sHifAM3L5l6kcNAU0W0kDf4fpmVbNiyLEAsSZFXdtSaLSYao0Y+DHgrWGcepdZRW/4qzFhxu8dKX0KcljLqHqC/KCnk3EMfVIKL3rwneD75D+UlRrfTm4DmIR2hAhQCr3b+zN6SDfntbVJwIAwKnQAFqPnWzmNU/YhyMRu+FrBVxFRoDzOjJ7j9vdSTx36Z4KyjrbwXiA8MrzRqRvFtDEeF9x04KsuJIu8JeMaNvw8toFYYLLwLUpD0jGpR1Zr6f8s4Tj0MtmFjl2KKzXkX7ufMq0Uemcaj+fD2yocSdqw41G68CDtYcG13TvnN/deYDdTOK4Tt4H4c0ZOgUV8f0oTJatZYwv4AZfRUVEAwioRLPy0vAEWkQ= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GdK5TzQYlhBUam40CEoJBwWS9eCKnOtrGGThsEUu9sMMCEx+auAFARqc4y3E23RKsaPQ2o1bXbP8wYKVyKRcahGp7yRYUpOQI2V3v2zsX04rc2sahi7B8oOgSSGxvCFsp7oxQ4EVxPdjiVGUzjZKEGvRYnUrr1YshT7KZM4fnLMY2MLQnoRlaAGB4KZdDIL3f0Hv4OfE3xHr6soDZOz8F14B40zw1bvQ+BC8xNxMOf5A5fPBT9GzB3Mgvb6fqv5oZChEN3/0v9OP5UHXRfpEkqQz0V2grfTUuOFiFWeMhGucAqJeTt5MGMonoPU0PHZ/5KMUqML7mnlCpjhbWMS6fx4wVJx5oawBhc2mqv+YTlUNRkL1a+Ap3K19kV8E6kPku6xuzi4FMnu7eLqwt9BQyXtgyjlVk/VpDvS4l4yiUkmcLKXKrXdNIFNRLH6sCDSTD0/GLS1IBLx9rlYsAku88uKyWWrXuHN7VT1OJqvkPWEhVyIxLokdc5C1fYnxomC4p/SZCJ5bRnw4jr7M1oiIdH/r8WF6tebL5haHkHMlRcgqfX3tC5crMVflBFei2P6lPsgNke4Y1Ugcnq1K8HsqDPiSfog33eF3KAd5QwP0OHxReIogo3db2xpuOjV1EgB8svrvmiirbreb5IDGRPrG4kzmcKjuXfIyHr+2RtYvF7gusgnB7j9NS/wIEz5ItIdq9+M36DDB0SjPBtYnXUqapA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 689b8449-d221-4174-5dcd-08d9a3ab2f6f X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2021 18:03:08.2080 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR03MB2929 Subject: [FFmpeg-devel] [PATCH 17/17] fftools/ffmpeg_opt: Apply copyinkf for all stream types 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: pKY3OM3uEsye The earlier code has ignored it for all stream types except video and subtitles, probably because audio was presumed to only consist of keyframes. Yet this assumption is not true for e.g. TrueHD. Signed-off-by: Andreas Rheinhardt --- fftools/ffmpeg_opt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index ab4c63a362..60ee6b16b5 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1655,6 +1655,9 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e ost->muxing_queue = av_fifo_alloc(8 * sizeof(AVPacket)); if (!ost->muxing_queue) exit_program(1); + if (ost->stream_copy) + MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, + ost->copy_initial_nonkeyframes, oc, st); return ost; } @@ -1940,8 +1943,6 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in ost->avfilter = get_ost_filters(o, oc, ost); if (!ost->avfilter) exit_program(1); - } else { - MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc ,st); } if (ost->stream_copy) @@ -2069,8 +2070,6 @@ static OutputStream *new_subtitle_stream(OptionsContext *o, AVFormatContext *oc, subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE; - MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc, st); - if (!ost->stream_copy) { char *frame_size = NULL;