From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 5AC244BCD1 for ; Sun, 2 Feb 2025 18:56:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C94468B8F2; Sun, 2 Feb 2025 20:55:57 +0200 (EET) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4492D68BC57 for ; Sun, 2 Feb 2025 20:55:51 +0200 (EET) Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6e24859f0c5so32492726d6.3 for ; Sun, 02 Feb 2025 10:55:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738522550; x=1739127350; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=m8kUyh7LipTgmjSGNuNxd4m8glrHk6ivCz4neHU7dWU=; b=OIHanv9y+LF3EUsCwJLRVRhJBjujdUmflu2Qgau+9rGdmwqK5bFp/2bGU+lQnMVhFC qBEElUCQj+979MQhhWrUHKS4dAGDjMdqQxftodcBnsZ99QVmcSSPG+nBm6HAH04IvG5U Nc7OQZgqgMB858rkxcYrEybudchdTqYcv0XppUEXk50j4T86Q9SBqAWV+SYHStpkBeOG hvUTlTaPOKKMpI6DdiT0RTrOOcXUyoRD1xOVD2ND9QI0Dk9UeHoKyd5DtOWYWdwVyTQW KgyQaIQSLbqkLYc2cu9Q5phOuoHqK9HlH0YpkxhchhTrIaafXpFq07bNFfXbbqN3l4kk +g8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738522550; x=1739127350; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m8kUyh7LipTgmjSGNuNxd4m8glrHk6ivCz4neHU7dWU=; b=bR5BCqZCKmntb1W15cB7Mohk5nF50BU3l6ZPK0IohtY+BQxcFzytW5XX6XoZWl2ALD sIwJmMzU39YhzDekxWAQNdajGKtCnT9/pSza6uj3zHgmd7K/ch3AxU95mrKTPxapvwfA x2q6RlYFkJyC5dOmjbQuFmeyM2+vVJWHiUNQQrh6MDdL1kds928EDQbnAugButPhzZln nixzdJXePZx9AE77WLc3ebrtNRqKo4/toM8E6seiY/Y8eGEVO/pCovcSLaw8x7fXklEL alM8LmkB+rxfdsXxmfcsVKSLlt2M3lK7RXz/hVr5w6xE/3UJ+CX85orkjInZGnmirK7t XAPA== X-Gm-Message-State: AOJu0YxKYV3goBXlV8UGYgyy7r2omEOpOBQW+jsCUvapeC6nF6KiVGwZ Klzsk14LEgJNhSHpAZAldPDg46VlMJ5OTqDiiWrXzPgdR2x/c7pR1nQ/qg== X-Gm-Gg: ASbGncsMvjww6UbX/UK5m/i6uEQufd7hIpVtcRU9PivdzH7gdSBZzgj9YWpOnYp7j1x RM1gp1iLrNlofsrLlQJPqfAsEefzB3KnU16FdgPfwDWuKKunarjByfbCo+GvkbVRqTPZQgE9t5/ Dk+raQzNv/4RK1OlTnVihDw2G0yLABsSU5reNaz0jXsDCMDUaAJbjeHDYyMWb9VP53dpLNHM8nS Jmvs8CI9tT3Ks7ryLVR20G1tYT12uGdopdecqha8o86iNx/CEs+cQ8+yZlkF+P68dsGvooZN1vo teSOLW4bp8rxS3b5aVm/xo0JNdeyYKsf5kCczf+GCQ+1rRZXaB7nn1uamd1Ca9xtZS3ynUe8 X-Google-Smtp-Source: AGHT+IF1E+Ojh9xQN68Q7L81Iq9TIaCqr54KXLFd+CNsq7hufFB8FX7enmpuqGe3a0QWdEG0YgrD9A== X-Received: by 2002:a05:6214:3d01:b0:6d4:1f86:b1e6 with SMTP id 6a1803df08f44-6e243c381cemr314994626d6.22.1738522549715; Sun, 02 Feb 2025 10:55:49 -0800 (PST) Received: from scott-desktop.. (pool-108-56-160-50.washdc.fios.verizon.net. [108.56.160.50]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e25495e76bsm41464436d6.125.2025.02.02.10.55.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Feb 2025 10:55:48 -0800 (PST) From: Scott Theisen To: ffmpeg-devel@ffmpeg.org Date: Sun, 2 Feb 2025 13:55:03 -0500 Message-ID: <20250202185547.142728-1-scott.the.elm@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] libavcodec/mpeg12dec.c: rename 0x0502 CC format 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: The format is used by at least Dish Network, but is not defined in any DVB standard, so remove references to DVB. This is a simple rename, no functional change. --- libavcodec/mpeg12dec.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 9bb995b5be..0002f016e9 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -67,7 +67,7 @@ enum Mpeg2ClosedCaptionsFormat { CC_FORMAT_A53_PART4, CC_FORMAT_SCTE20, CC_FORMAT_DVD, - CC_FORMAT_DVB_0502 + CC_FORMAT_DISH }; typedef struct Mpeg1Context { @@ -2064,39 +2064,39 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx, mpeg_set_cc_format(avctx, CC_FORMAT_DVD, "DVD"); } return 1; - } else if ((!s1->cc_format || s1->cc_format == CC_FORMAT_DVB_0502) && + } else if ((!s1->cc_format || s1->cc_format == CC_FORMAT_DISH) && buf_size >= 12 && p[0] == 0x05 && p[1] == 0x02) { - /* extract DVB 0502 CC data */ + /* extract Dish Network CC data */ const uint8_t cc_header = 0xf8 | 0x04 /* valid */ | 0x00 /* line 21 field 1 */; uint8_t cc_data[4] = {0}; int cc_count = 0; - uint8_t dvb_cc_type = p[7]; + uint8_t cc_type = p[7]; p += 8; buf_size -= 8; - if (dvb_cc_type == 0x05 && buf_size >= 7) { - dvb_cc_type = p[6]; + if (cc_type == 0x05 && buf_size >= 7) { + cc_type = p[6]; p += 7; buf_size -= 7; } - if (dvb_cc_type == 0x02 && buf_size >= 4) { /* 2-byte caption, can be repeated */ + if (cc_type == 0x02 && buf_size >= 4) { /* 2-byte caption, can be repeated */ cc_count = 1; cc_data[0] = p[1]; cc_data[1] = p[2]; - dvb_cc_type = p[3]; + cc_type = p[3]; /* Only repeat characters when the next type flag * is 0x04 and the characters are repeatable (i.e., less than * 32 with the parity stripped). */ - if (dvb_cc_type == 0x04 && (cc_data[0] & 0x7f) < 32) { + if (cc_type == 0x04 && (cc_data[0] & 0x7f) < 32) { cc_count = 2; cc_data[2] = cc_data[0]; cc_data[3] = cc_data[1]; } - } else if (dvb_cc_type == 0x04 && buf_size >= 5) { /* 4-byte caption, not repeated */ + } else if (cc_type == 0x04 && buf_size >= 5) { /* 4-byte caption, not repeated */ cc_count = 2; cc_data[0] = p[1]; cc_data[1] = p[2]; @@ -2124,7 +2124,7 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx, } } - mpeg_set_cc_format(avctx, CC_FORMAT_DVB_0502, "DVB 0502"); + mpeg_set_cc_format(avctx, CC_FORMAT_DISH, "Dish Network"); } return 1; } @@ -2687,7 +2687,7 @@ const FFCodec ff_mpeg1video_decoder = { static const AVOption mpeg2video_options[] = { { "cc_format", "extract a specific Closed Captions format", M2V_OFFSET(cc_format), AV_OPT_TYPE_INT, { .i64 = CC_FORMAT_AUTO }, - CC_FORMAT_AUTO, CC_FORMAT_DVB_0502, M2V_PARAM, .unit = "cc_format" }, + CC_FORMAT_AUTO, CC_FORMAT_DISH, M2V_PARAM, .unit = "cc_format" }, { "auto", "pick first seen CC substream", 0, AV_OPT_TYPE_CONST, { .i64 = CC_FORMAT_AUTO }, .flags = M2V_PARAM, .unit = "cc_format" }, @@ -2697,8 +2697,8 @@ static const AVOption mpeg2video_options[] = { { .i64 = CC_FORMAT_SCTE20 }, .flags = M2V_PARAM, .unit = "cc_format" }, { "dvd", "pick DVD CC substream", 0, AV_OPT_TYPE_CONST, { .i64 = CC_FORMAT_DVD }, .flags = M2V_PARAM, .unit = "cc_format" }, - { "dvb_0502", "pick DVB 0502 CC substream", 0, AV_OPT_TYPE_CONST, - { .i64 = CC_FORMAT_DVB_0502 }, .flags = M2V_PARAM, .unit = "cc_format" }, + { "dish", "pick Dish Network CC substream", 0, AV_OPT_TYPE_CONST, + { .i64 = CC_FORMAT_DISH }, .flags = M2V_PARAM, .unit = "cc_format" }, { NULL } }; -- 2.43.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".