Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avformat/mccenc: Various stuff (PR #20556)
@ 2025-09-19 19:17 mkver via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: mkver via ffmpeg-devel @ 2025-09-19 19:17 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: mkver

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 <andreas.rheinhardt@outlook.com>
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 <andreas.rheinhardt@outlook.com>
---
 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 <andreas.rheinhardt@outlook.com>
Date: Fri, 19 Sep 2025 18:49:42 +0200
Subject: [PATCH 02/11] avformat/mccenc: Fix assert check

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 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 <andreas.rheinhardt@outlook.com>
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 <andreas.rheinhardt@outlook.com>
---
 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 <andreas.rheinhardt@outlook.com>
Date: Fri, 19 Sep 2025 19:16:44 +0200
Subject: [PATCH 04/11] avformat/mccenc: Constify read-only data

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 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 <andreas.rheinhardt@outlook.com>
Date: Fri, 19 Sep 2025 19:53:33 +0200
Subject: [PATCH 05/11] avformat/mccenc: Deduplicate strings

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 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 <andreas.rheinhardt@outlook.com>
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 <andreas.rheinhardt@outlook.com>
---
 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 <andreas.rheinhardt@outlook.com>
Date: Fri, 19 Sep 2025 20:00:00 +0200
Subject: [PATCH 07/11] avformat/mccenc: Add newlines to logmessages

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 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 <andreas.rheinhardt@outlook.com>
Date: Fri, 19 Sep 2025 20:36:18 +0200
Subject: [PATCH 08/11] avformat/mccenc: Avoid relocations

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 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 <andreas.rheinhardt@outlook.com>
Date: Fri, 19 Sep 2025 20:40:50 +0200
Subject: [PATCH 09/11] avformat/mccdec: Avoid relocations

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 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 <andreas.rheinhardt@outlook.com>
Date: Fri, 19 Sep 2025 20:56:10 +0200
Subject: [PATCH 10/11] avformat/mccenc: Hardcode codec names

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 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 <andreas.rheinhardt@outlook.com>
Date: Fri, 19 Sep 2025 20:56:36 +0200
Subject: [PATCH 11/11] avformat/mccdec: Constify data

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-19 19:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-19 19:17 [FFmpeg-devel] [PATCH] avformat/mccenc: Various stuff (PR #20556) mkver via ffmpeg-devel

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git