From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id D83A444B48 for ; Fri, 19 Sep 2025 19:17:42 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'zezv9zTsf7VgdNuLshZu8ZQNauSl/BBngTTn53Oadss=', expected b'g5lJiyYqJ4nHdYtP9RqiJfrVeYSnNB6JdhSbqx+UEMc=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1758309446; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=zezv9zTsf7VgdNuLshZu8ZQNauSl/BBngTTn53Oadss=; b=35cDqbMDt015FLL8Yz3HgCXmz+CdOkwN9SWvpbUA58i4HBTPUEFGG2ys+iSV9iAUpiOkC P9xV02FUlA9zk+0QaS5Y5qiB+ol4wbBeynvfy7Oo5dtpZGpch0dzic70AuYCMal5G7OTGYY laMp0JTD12gEs0cjK0WCCLYct8+zRPqSl609xByeIeQA9WTXcQW775oFyFUUH+QtsvalrtD BjtU9ABe+hRmYjnDs+n4FiaLbuSC5g2evD4Od/bXd4p0lMPDTpnEbHWJzO11Llgc8uNu1sb vPXtXCqwprpOAIKxuQB8THJSRBOe4KwRnhysiNl8Yg4EbvfoSjfc+sQbKaeQ== Received: from [172.19.0.4] (unknown [172.19.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 7902F68EB5F; Fri, 19 Sep 2025 22:17:26 +0300 (EEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1758309444; b=esA5x28zvf+ZOogB7CBbgFjkciPwqK5YcAmnhoRhR+mFjXWig3bongNnDGn8uZl+ib2cq xXrPBwijRkIWJfveqG1Q1/t7hc1KabMkSseAmBS2xRdyPK8M70kexu8dELKWIUqQBK5fOba veeOA74+5DM7orst5t7K98eBHwV82cSOnSuIxaFT8H94yxePERMifR7yeWHwFlCUqhW/rk+ o8WXq6W9+sMGoMKazQctHUWoCqgKH9topwhbsbiU6K4dyDPVReZeP78My7V25i5+rppNR5e N8scs36acqfoFk1G6onhOfCnEDL6aNSKiC9eGS/Uy1/XYaV++dU06qNHBpVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1758309444; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=9xCkaMyABDZPb+m39DUldspeCr7u87lWa4BvoQYpFJw=; b=p1juxJXpmnpRDmLb3I8Dpjg9PMFuJbgtXFsj1awsMmSTxKK1si/lwAjQePjmL2VTr5+fb 3DQwtdf09KPz/jwhHKqgXBvqQPF2Y2ejMcsyClYokmkWf8SYYutt0aFO80Sk98sqPKyYeG6 QZg3WZHjrbFtnGIOU26NQa9/46Ie+5DCM3aV5yAf2ZNYVh0GYD6gbmafSoabxM8GwGaX0PZ 1OVlUfiycQxiNyflbw+ToCTutt1djIliNr6YfsNORKPTegmYLE+0QX598fR84cEuXL8ZDlT K34pMZObZDNCd1uRnz4+uOjKsaQKZyh3EyEHgXOAdQ6nrU53bmYSOmxsOU+Q== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=none Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1758309437; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=g5lJiyYqJ4nHdYtP9RqiJfrVeYSnNB6JdhSbqx+UEMc=; b=YzvyQYkCEPqf5/ad+940m34qcyH6e2LaFIDRItDlGnxqf/V7vucaIy6JywJJA8xXbq/hl 0Lqi5qVtUGjYDRY4VU4su6RsfOeGgk5ox+INXDyjIXjAioN5Ejgsqtu9I4VeSPdjQi8qghT PpHMU2JnJJQKN5LZcFq1Lewt8UCCx5iGaTTRglELYRUGhRcuNTTbaJCic+6rABsPGq3vMB1 IV9bpWTpTLSjzss9eC71bSlGujJ89aArP+3lDk0Ke4iuQcXZS7YDOuVVZAmKRYljMjTHEFk SNM8pOVaVaWsa6QgU8o9PNdFY0ivzFTlTdxt5iMf4IT3maBkvWSnlAAHrfBQ== Received: from ed19c606a818 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id A75F068E853 for ; Fri, 19 Sep 2025 22:17:17 +0300 (EEST) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Sep 2025 19:17:17 -0000 Message-ID: <175830943786.25.7924441956285422763@463a07221176> Message-ID-Hash: RQ7VRC3JZKCSVFZJOINDRQT6VVE35J67 X-Message-ID-Hash: RQ7VRC3JZKCSVFZJOINDRQT6VVE35J67 X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avformat/mccenc: Various stuff (PR #20556) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: mkver via ffmpeg-devel Cc: mkver Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20556 opened by mkver URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20556 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20556.patch Also a bit mccdec. >>From 8e4cbb053bd2dd9c345701e940e5ff4ec2eca766 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 19 Sep 2025 19:42:24 +0200 Subject: [PATCH 01/11] avformat/mccenc: Remove redundant check This has already been checked in init. Signed-off-by: Andreas Rheinhardt --- libavformat/mccenc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libavformat/mccenc.c b/libavformat/mccenc.c index 298bc6dd1a..f978c420a3 100644 --- a/libavformat/mccenc.c +++ b/libavformat/mccenc.c @@ -158,10 +158,6 @@ static AVRational valid_time_code_rates[] = { static int mcc_write_header(AVFormatContext *avf) { MCCContext *mcc = avf->priv_data; - if (avf->nb_streams != 1) { - av_log(avf, AV_LOG_ERROR, "mcc muxer supports at most one stream\n"); - return AVERROR(EINVAL); - } avpriv_set_pts_info(avf->streams[0], 64, mcc->timecode.rate.den, mcc->timecode.rate.num); const char *mcc_header = mcc_header_v1; switch ((MCCVersion)mcc->mcc_version) { -- 2.49.1 >>From ad7261e64b7bfa201c89c8ac841b0e4b8101bd95 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 19 Sep 2025 18:49:42 +0200 Subject: [PATCH 02/11] avformat/mccenc: Fix assert check Signed-off-by: Andreas Rheinhardt --- libavformat/mccenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mccenc.c b/libavformat/mccenc.c index f978c420a3..02541caeb3 100644 --- a/libavformat/mccenc.c +++ b/libavformat/mccenc.c @@ -208,7 +208,7 @@ static int mcc_write_header(AVFormatContext *avf) "December", }; // assert that values are sane so we don't index out of bounds - av_assert0(tm.tm_mon >= 0 && tm.tm_mon <= FF_ARRAY_ELEMS(months)); + av_assert0(tm.tm_mon >= 0 && tm.tm_mon < FF_ARRAY_ELEMS(months)); const char *month = months[tm.tm_mon]; static const char *const weekdays[7] = { -- 2.49.1 >>From f778c205222909aac0f3f70bb439076272adb0ee Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 19 Sep 2025 19:16:06 +0200 Subject: [PATCH 03/11] avformat/mccenc: Remove redundant setting of time base It has already been done in init. Signed-off-by: Andreas Rheinhardt --- libavformat/mccenc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/mccenc.c b/libavformat/mccenc.c index 02541caeb3..bdc8425408 100644 --- a/libavformat/mccenc.c +++ b/libavformat/mccenc.c @@ -158,7 +158,6 @@ static AVRational valid_time_code_rates[] = { static int mcc_write_header(AVFormatContext *avf) { MCCContext *mcc = avf->priv_data; - avpriv_set_pts_info(avf->streams[0], 64, mcc->timecode.rate.den, mcc->timecode.rate.num); const char *mcc_header = mcc_header_v1; switch ((MCCVersion)mcc->mcc_version) { case MCC_VERSION_1: -- 2.49.1 >>From 0b30d2bd8a6e4f53d5dc8286ef63b4931dceb196 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 19 Sep 2025 19:16:44 +0200 Subject: [PATCH 04/11] avformat/mccenc: Constify read-only data Signed-off-by: Andreas Rheinhardt --- libavformat/mccenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mccenc.c b/libavformat/mccenc.c index bdc8425408..c46fa033cc 100644 --- a/libavformat/mccenc.c +++ b/libavformat/mccenc.c @@ -145,7 +145,7 @@ static const char mcc_header_v2[] = // */ static const char mcc_ffmpeg_uuid[] = "0087C4F6-A6B4-5469-8C8E-BBF44950401D"; -static AVRational valid_time_code_rates[] = { +static const AVRational valid_time_code_rates[] = { { .num = 24, .den = 1 }, { .num = 25, .den = 1 }, { .num = 30000, .den = 1001 }, -- 2.49.1 >>From eacf11da84a2dd77d945cf98e9338f955bcc9d40 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 19 Sep 2025 19:53:33 +0200 Subject: [PATCH 05/11] avformat/mccenc: Deduplicate strings Signed-off-by: Andreas Rheinhardt --- libavformat/mccenc.c | 122 +++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 81 deletions(-) diff --git a/libavformat/mccenc.c b/libavformat/mccenc.c index c46fa033cc..1baa007d66 100644 --- a/libavformat/mccenc.c +++ b/libavformat/mccenc.c @@ -58,83 +58,47 @@ typedef enum MCCVersion MCC_VERSION_MAX = MCC_VERSION_2, } MCCVersion; -static const char mcc_header_v1[] = // - "File Format=MacCaption_MCC V1.0\n" - "\n" +#define MCC_HEADER \ + "File Format=MacCaption_MCC V%c.0\n" \ + "\n" \ + "///////////////////////////////////////////////////////////////////////////////////\n" \ + "// Computer Prompting and Captioning Company\n" \ + "// Ancillary Data Packet Transfer File\n" \ + "//\n" \ + "// Permission to generate this format is granted provided that\n" \ + "// 1. This ANC Transfer file format is used on an as-is basis and no warranty is given, and\n" \ + "// 2. This entire descriptive information text is included in a generated .mcc file.\n" \ + "//\n" \ + "// General file format:\n" \ + "// HH:MM:SS:FF(tab)[Hexadecimal ANC data in groups of 2 characters]\n" \ + "// Hexadecimal data starts with the Ancillary Data Packet DID (Data ID defined in S291M)\n" \ + "// and concludes with the Check Sum following the User Data Words.\n" \ + "// Each time code line must contain at most one complete ancillary data packet.\n" \ + "// To transfer additional ANC Data successive lines may contain identical time code.\n" \ + "// Time Code Rate=[24, 25, 30, 30DF, 50, 60%s]\n" \ + "//\n" \ + "// ANC data bytes may be represented by one ASCII character according to the following schema:\n" \ + "// G FAh 00h 00h\n" \ + "// H 2 x (FAh 00h 00h)\n" \ + "// I 3 x (FAh 00h 00h)\n" \ + "// J 4 x (FAh 00h 00h)\n" \ + "// K 5 x (FAh 00h 00h)\n" \ + "// L 6 x (FAh 00h 00h)\n" \ + "// M 7 x (FAh 00h 00h)\n" \ + "// N 8 x (FAh 00h 00h)\n" \ + "// O 9 x (FAh 00h 00h)\n" \ + "// P FBh 80h 80h\n" \ + "// Q FCh 80h 80h\n" \ + "// R FDh 80h 80h\n" \ + "// S 96h 69h\n" \ + "// T 61h 01h\n" \ + "// U E1h 00h 00h 00h\n" \ + "// Z 00h\n" \ + "//\n" \ "///////////////////////////////////////////////////////////////////////////////////\n" - "// Computer Prompting and Captioning Company\n" - "// Ancillary Data Packet Transfer File\n" - "//\n" - "// Permission to generate this format is granted provided that\n" - "// 1. This ANC Transfer file format is used on an as-is basis and no warranty is given, and\n" - "// 2. This entire descriptive information text is included in a generated .mcc file.\n" - "//\n" - "// General file format:\n" - "// HH:MM:SS:FF(tab)[Hexadecimal ANC data in groups of 2 characters]\n" - "// Hexadecimal data starts with the Ancillary Data Packet DID (Data ID defined in S291M)\n" - "// and concludes with the Check Sum following the User Data Words.\n" - "// Each time code line must contain at most one complete ancillary data packet.\n" - "// To transfer additional ANC Data successive lines may contain identical time code.\n" - "// Time Code Rate=[24, 25, 30, 30DF, 50, 60]\n" - "//\n" - "// ANC data bytes may be represented by one ASCII character according to the following schema:\n" - "// G FAh 00h 00h\n" - "// H 2 x (FAh 00h 00h)\n" - "// I 3 x (FAh 00h 00h)\n" - "// J 4 x (FAh 00h 00h)\n" - "// K 5 x (FAh 00h 00h)\n" - "// L 6 x (FAh 00h 00h)\n" - "// M 7 x (FAh 00h 00h)\n" - "// N 8 x (FAh 00h 00h)\n" - "// O 9 x (FAh 00h 00h)\n" - "// P FBh 80h 80h\n" - "// Q FCh 80h 80h\n" - "// R FDh 80h 80h\n" - "// S 96h 69h\n" - "// T 61h 01h\n" - "// U E1h 00h 00h 00h\n" - "// Z 00h\n" - "//\n" - "///////////////////////////////////////////////////////////////////////////////////\n"; -static const char mcc_header_v2[] = // - "File Format=MacCaption_MCC V2.0\n" - "\n" - "///////////////////////////////////////////////////////////////////////////////////\n" - "// Computer Prompting and Captioning Company\n" - "// Ancillary Data Packet Transfer File\n" - "//\n" - "// Permission to generate this format is granted provided that\n" - "// 1. This ANC Transfer file format is used on an as-is basis and no warranty is given, and\n" - "// 2. This entire descriptive information text is included in a generated .mcc file.\n" - "//\n" - "// General file format:\n" - "// HH:MM:SS:FF(tab)[Hexadecimal ANC data in groups of 2 characters]\n" - "// Hexadecimal data starts with the Ancillary Data Packet DID (Data ID defined in S291M)\n" - "// and concludes with the Check Sum following the User Data Words.\n" - "// Each time code line must contain at most one complete ancillary data packet.\n" - "// To transfer additional ANC Data successive lines may contain identical time code.\n" - "// Time Code Rate=[24, 25, 30, 30DF, 50, 60, 60DF]\n" - "//\n" - "// ANC data bytes may be represented by one ASCII character according to the following schema:\n" - "// G FAh 00h 00h\n" - "// H 2 x (FAh 00h 00h)\n" - "// I 3 x (FAh 00h 00h)\n" - "// J 4 x (FAh 00h 00h)\n" - "// K 5 x (FAh 00h 00h)\n" - "// L 6 x (FAh 00h 00h)\n" - "// M 7 x (FAh 00h 00h)\n" - "// N 8 x (FAh 00h 00h)\n" - "// O 9 x (FAh 00h 00h)\n" - "// P FBh 80h 80h\n" - "// Q FCh 80h 80h\n" - "// R FDh 80h 80h\n" - "// S 96h 69h\n" - "// T 61h 01h\n" - "// U E1h 00h 00h 00h\n" - "// Z 00h\n" - "//\n" - "///////////////////////////////////////////////////////////////////////////////////\n"; +#define MCC_HEADER_PRINTF_ARGS(mcc_version) (mcc_version) + '0', \ + (mcc_version) == MCC_VERSION_1 ? "" : ", 60DF" /** * generated with the bash command: @@ -158,7 +122,6 @@ static const AVRational valid_time_code_rates[] = { static int mcc_write_header(AVFormatContext *avf) { MCCContext *mcc = avf->priv_data; - const char *mcc_header = mcc_header_v1; switch ((MCCVersion)mcc->mcc_version) { case MCC_VERSION_1: if (mcc->timecode.fps == 60 && mcc->timecode.flags & AV_TIMECODE_FLAG_DROPFRAME) { @@ -166,9 +129,6 @@ static int mcc_write_header(AVFormatContext *avf) return AVERROR(EINVAL); } break; - case MCC_VERSION_2: - mcc_header = mcc_header_v2; - break; } const char *creation_program = mcc->creation_program; if (!creation_program) { @@ -218,13 +178,13 @@ static int mcc_write_header(AVFormatContext *avf) const char *weekday = weekdays[tm.tm_wday]; avio_printf(avf->pb, - "%s\n" + MCC_HEADER "\n" "UUID=%s\n" "Creation Program=%s\n" "Creation Date=%s, %s %d, %d\n" "Creation Time=%02d:%02d:%02d\n" "Time Code Rate=%u%s\n\n", - mcc_header, + MCC_HEADER_PRINTF_ARGS(mcc->mcc_version), mcc_ffmpeg_uuid, creation_program, weekday, -- 2.49.1 >>From 30ec35158b2118c97d211b16b6c5e2763e277229 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 19 Sep 2025 19:55:51 +0200 Subject: [PATCH 06/11] avformat/mccenc: Check version-timecode compatibility earlier Signed-off-by: Andreas Rheinhardt --- libavformat/mccenc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libavformat/mccenc.c b/libavformat/mccenc.c index 1baa007d66..14f67e420a 100644 --- a/libavformat/mccenc.c +++ b/libavformat/mccenc.c @@ -122,14 +122,6 @@ static const AVRational valid_time_code_rates[] = { static int mcc_write_header(AVFormatContext *avf) { MCCContext *mcc = avf->priv_data; - switch ((MCCVersion)mcc->mcc_version) { - case MCC_VERSION_1: - if (mcc->timecode.fps == 60 && mcc->timecode.flags & AV_TIMECODE_FLAG_DROPFRAME) { - av_log(avf, AV_LOG_FATAL, "MCC Version 1.0 doesn't support 60DF (59.94 fps drop-frame)"); - return AVERROR(EINVAL); - } - break; - } const char *creation_program = mcc->creation_program; if (!creation_program) { if (avf->flags & AVFMT_FLAG_BITEXACT) @@ -422,6 +414,13 @@ static int mcc_init(AVFormatContext *avf) if (ret < 0) return ret; + if (mcc->mcc_version == MCC_VERSION_1) { + if (mcc->timecode.fps == 60 && mcc->timecode.flags & AV_TIMECODE_FLAG_DROPFRAME) { + av_log(avf, AV_LOG_FATAL, "MCC Version 1.0 doesn't support 60DF (59.94 fps drop-frame)"); + return AVERROR(EINVAL); + } + } + // get av_timecode to calculate how many frames are in 24hr ret = av_timecode_init_from_components(&twenty_four_hr, time_code_rate, timecode_flags, 24, 0, 0, 0, avf); if (ret < 0) -- 2.49.1 >>From 9e7c5d4c9d55105a6a53ec633d39aacdfbc92ba2 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 19 Sep 2025 20:00:00 +0200 Subject: [PATCH 07/11] avformat/mccenc: Add newlines to logmessages Signed-off-by: Andreas Rheinhardt --- libavformat/mccenc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavformat/mccenc.c b/libavformat/mccenc.c index 14f67e420a..d34b8625c4 100644 --- a/libavformat/mccenc.c +++ b/libavformat/mccenc.c @@ -129,15 +129,15 @@ static int mcc_write_header(AVFormatContext *avf) else creation_program = "FFmpeg version " FFMPEG_VERSION; } else if (strchr(creation_program, '\n')) { - av_log(avf, AV_LOG_FATAL, "creation_program must not contain multiple lines of text"); + av_log(avf, AV_LOG_FATAL, "creation_program must not contain multiple lines of text\n"); return AVERROR(EINVAL); } if (avf->flags & AVFMT_FLAG_BITEXACT && !av_strcasecmp(mcc->creation_time, "now")) - av_log(avf, AV_LOG_ERROR, "creation_time must be overridden for bit-exact output"); + av_log(avf, AV_LOG_ERROR, "creation_time must be overridden for bit-exact output\n"); int64_t timeval = 0; int ret = av_parse_time(&timeval, mcc->creation_time, 0); if (ret < 0) { - av_log(avf, AV_LOG_FATAL, "can't parse creation_time"); + av_log(avf, AV_LOG_FATAL, "can't parse creation_time\n"); return ret; } struct tm tm; @@ -326,7 +326,7 @@ static int mcc_write_packet(AVFormatContext *avf, AVPacket *pkt) default: av_log(avf, AV_LOG_WARNING, - "Unsupported SMPTE 436M ANC Wrapping Type %#x -- discarding ANC packet", + "Unsupported SMPTE 436M ANC Wrapping Type %#x -- discarding ANC packet\n", (unsigned)coded_anc.wrapping_type); continue; } @@ -344,7 +344,7 @@ static int mcc_write_packet(AVFormatContext *avf, AVPacket *pkt) av_log(avf, AV_LOG_WARNING, "MCC Version 1.0 doesn't support ANC packets where the field number (got %u) isn't 0 and " - "line number (got %u) isn't 9: discarding ANC packet", + "line number (got %u) isn't 9: discarding ANC packet\n", field_number, (unsigned)coded_anc.line_number); continue; @@ -416,7 +416,7 @@ static int mcc_init(AVFormatContext *avf) if (mcc->mcc_version == MCC_VERSION_1) { if (mcc->timecode.fps == 60 && mcc->timecode.flags & AV_TIMECODE_FLAG_DROPFRAME) { - av_log(avf, AV_LOG_FATAL, "MCC Version 1.0 doesn't support 60DF (59.94 fps drop-frame)"); + av_log(avf, AV_LOG_FATAL, "MCC Version 1.0 doesn't support 60DF (59.94 fps drop-frame)\n"); return AVERROR(EINVAL); } } -- 2.49.1 >>From 4705b7d4b009632453d9f5875655357a39accb99 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 19 Sep 2025 20:36:18 +0200 Subject: [PATCH 08/11] avformat/mccenc: Avoid relocations Signed-off-by: Andreas Rheinhardt --- libavformat/mccenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/mccenc.c b/libavformat/mccenc.c index d34b8625c4..1fbeebfe0f 100644 --- a/libavformat/mccenc.c +++ b/libavformat/mccenc.c @@ -144,7 +144,7 @@ static int mcc_write_header(AVFormatContext *avf) if (!localtime_r((time_t[1]){ timeval / 1000000 }, &tm)) return AVERROR(EINVAL); // we can't rely on having the C locale, so convert the date/time to a string ourselves: - static const char *const months[12] = { + static const char months[12][10] = { "January", "February", "March", @@ -162,7 +162,7 @@ static int mcc_write_header(AVFormatContext *avf) av_assert0(tm.tm_mon >= 0 && tm.tm_mon < FF_ARRAY_ELEMS(months)); const char *month = months[tm.tm_mon]; - static const char *const weekdays[7] = { + static const char weekdays[7][10] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; // assert that values are sane so we don't index out of bounds -- 2.49.1 >>From d08bac25b3175172e714bf714b3f0272f288fcf9 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 19 Sep 2025 20:40:50 +0200 Subject: [PATCH 09/11] avformat/mccdec: Avoid relocations Signed-off-by: Andreas Rheinhardt --- libavformat/mccdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mccdec.c b/libavformat/mccdec.c index 8a9eff4c2a..71882d13a9 100644 --- a/libavformat/mccdec.c +++ b/libavformat/mccdec.c @@ -155,7 +155,7 @@ static int time_tracker_set_time(TimeTracker *tt, const MCCTimecode *tc, void *l struct ValidTimeCodeRate { AVRational rate; - const char *str; + char str[5]; }; static struct ValidTimeCodeRate valid_time_code_rates[] = { -- 2.49.1 >>From 33209282b4cf4de1c5be85c0b4b25e7a764fe00b Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 19 Sep 2025 20:56:10 +0200 Subject: [PATCH 10/11] avformat/mccenc: Hardcode codec names Signed-off-by: Andreas Rheinhardt --- libavformat/mccenc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavformat/mccenc.c b/libavformat/mccenc.c index 1fbeebfe0f..c64d53805d 100644 --- a/libavformat/mccenc.c +++ b/libavformat/mccenc.c @@ -437,9 +437,7 @@ static int mcc_init(AVFormatContext *avf) } else if (st->codecpar->codec_id != AV_CODEC_ID_SMPTE_436M_ANC) { av_log(avf, AV_LOG_ERROR, - "mcc muxer supports only codec %s or codec %s\n", - avcodec_get_name(AV_CODEC_ID_SMPTE_436M_ANC), - avcodec_get_name(AV_CODEC_ID_EIA_608)); + "mcc muxer supports only codec smpte_436m_anc or codec eia_608\n"); return AVERROR(EINVAL); } -- 2.49.1 >>From 927e0f8368f203069f6a5e1b9d592a840bde8a90 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 19 Sep 2025 20:56:36 +0200 Subject: [PATCH 11/11] avformat/mccdec: Constify data Signed-off-by: Andreas Rheinhardt --- libavformat/mccdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mccdec.c b/libavformat/mccdec.c index 71882d13a9..e9b6fa14b4 100644 --- a/libavformat/mccdec.c +++ b/libavformat/mccdec.c @@ -158,7 +158,7 @@ struct ValidTimeCodeRate { char str[5]; }; -static struct ValidTimeCodeRate valid_time_code_rates[] = { +static const struct ValidTimeCodeRate valid_time_code_rates[] = { { .rate = { .num = 24, .den = 1 }, .str = "24" }, { .rate = { .num = 25, .den = 1 }, .str = "25" }, { .rate = { .num = 30000, .den = 1001 }, .str = "30DF" }, -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org