From 5dd199f7e8c15aa4fa9c663c290a0cd45885f59f Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 12 May 2022 13:15:19 +1000 Subject: [PATCH] cccombiner: don't assume a single cea608 data packet per buffer e.g. 24fps can have up to 3 and would include either two field0 or field1 cea608 data. Part-of: --- .../ext/closedcaption/gstcccombiner.c | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.c b/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.c index 9d673a3084..15a41c1c97 100644 --- a/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.c +++ b/subprojects/gst-plugins-bad/ext/closedcaption/gstcccombiner.c @@ -486,7 +486,6 @@ schedule_cea608_s334_1a (GstCCCombiner * self, guint8 * data, guint len, guint8 field0_data[3], field1_data[3]; guint field0_len = 0, field1_len = 0; guint i; - gboolean field0_608 = FALSE, field1_608 = FALSE; if (len % 3 != 0) { GST_WARNING ("Invalid cc_data buffer size %u. Truncating to a multiple " @@ -496,11 +495,6 @@ schedule_cea608_s334_1a (GstCCCombiner * self, guint8 * data, guint len, for (i = 0; i < len / 3; i++) { if (data[i * 3] & 0x80) { - if (field0_608) - continue; - - field0_608 = TRUE; - if (data[i * 3 + 1] == 0x80 && data[i * 3 + 2] == 0x80) continue; @@ -508,11 +502,6 @@ schedule_cea608_s334_1a (GstCCCombiner * self, guint8 * data, guint len, field0_data[field0_len++] = data[i * 3 + 1]; field0_data[field0_len++] = data[i * 3 + 2]; } else { - if (field1_608) - continue; - - field1_608 = TRUE; - if (data[i * 3 + 1] == 0x80 && data[i * 3 + 2] == 0x80) continue; @@ -550,7 +539,6 @@ schedule_cea708_raw (GstCCCombiner * self, guint8 * data, guint len, guint8 field0_data[MAX_CDP_PACKET_LEN], field1_data[3]; guint field0_len = 0, field1_len = 0; guint i; - gboolean field0_608 = FALSE, field1_608 = FALSE; gboolean started_ccp = FALSE; if (len % 3 != 0) { @@ -568,11 +556,6 @@ schedule_cea708_raw (GstCCCombiner * self, guint8 * data, guint len, if (!cc_valid) continue; - if (field0_608) - continue; - - field0_608 = TRUE; - if (data[i * 3 + 1] == 0x80 && data[i * 3 + 2] == 0x80) continue; @@ -583,11 +566,6 @@ schedule_cea708_raw (GstCCCombiner * self, guint8 * data, guint len, if (!cc_valid) continue; - if (field1_608) - continue; - - field1_608 = TRUE; - if (data[i * 3 + 1] == 0x80 && data[i * 3 + 2] == 0x80) continue;