From 1d31c784e7903903110498a409168a7741701088 Mon Sep 17 00:00:00 2001 From: Shruti Date: Tue, 10 May 2016 19:50:16 +0530 Subject: [PATCH 1/3] Fixes #354 : Excessive XDS notices --- src/lib_ccx/ccx_decoders_xds.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/lib_ccx/ccx_decoders_xds.c b/src/lib_ccx/ccx_decoders_xds.c index 7da5a3d5..2ddc43ff 100644 --- a/src/lib_ccx/ccx_decoders_xds.c +++ b/src/lib_ccx/ccx_decoders_xds.c @@ -116,6 +116,9 @@ typedef struct ccx_decoders_xds_context int cur_xds_packet_type; struct ccx_common_timing_ctx *timing; + unsigned current_ar_start; + unsigned current_ar_end; + int xds_write_to_file; // Set to 1 if XDS data is to be written to file } ccx_decoders_xds_context_t; @@ -704,6 +707,7 @@ int xds_do_current_and_future (struct cc_subtitle *sub, struct ccx_decoders_xds_ case XDS_TYPE_ASPECT_RATIO_INFO: { unsigned ar_start, ar_end; + int changed = 0; was_proc = 1; if (ctx->cur_xds_payload_length < 5) // We need 2 data bytes break; @@ -712,13 +716,29 @@ int xds_do_current_and_future (struct cc_subtitle *sub, struct ccx_decoders_xds_ /* CEA-608-B: The starting line is computed by adding 22 to the decimal number represented by bits S0 to S5. The ending line is computing by substracting the decimal number represented by bits E0 to E5 from 262 */ + ar_start = (ctx->cur_xds_payload[2] & 0x1F) + 22; ar_end = 262 - (ctx->cur_xds_payload[3] & 0x1F); unsigned active_picture_height = ar_end - ar_start; float aspect_ratio = (float) 320 / active_picture_height; - ccx_common_logging.log_ftn("\rXDS Notice: Aspect ratio info, start line=%u, end line=%u\n", ar_start,ar_end); - ccx_common_logging.log_ftn("\rXDS Notice: Aspect ratio info, active picture height=%u, ratio=%f\n", active_picture_height, aspect_ratio); + /* ctx->current_ar_start */ + + if (ar_start != ctx->current_ar_start) + { + ctx->current_ar_start = ar_start; + ctx->current_ar_end = ar_end; + changed = 1; + ccx_common_logging.log_ftn("\rXDS Notice: Aspect ratio info, start line=%u, end line=%u\n", ar_start, ar_end); + ccx_common_logging.log_ftn("\rXDS Notice: Aspect ratio info, active picture height=%u, ratio=%f\n", active_picture_height, aspect_ratio); + } + else + { + ccx_common_logging.debug_ftn(CCX_DMT_DECODER_XDS, "\rXDS Notice: Aspect ratio info, start line=%u, end line=%u\n", ar_start, ar_end); + ccx_common_logging.debug_ftn(CCX_DMT_DECODER_XDS, "\rXDS Notice: Aspect ratio info, active picture height=%u, ratio=%f\n", active_picture_height, aspect_ratio); + } + + } case XDS_TYPE_PROGRAM_DESC_1: case XDS_TYPE_PROGRAM_DESC_2: From 0579d7d8d7017f0513856090060a582f6fa34d41 Mon Sep 17 00:00:00 2001 From: Shruti Date: Tue, 10 May 2016 19:51:08 +0530 Subject: [PATCH 2/3] Fixes #354 : Excessive XDS notices --- src/lib_ccx/ccx_decoders_xds.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib_ccx/ccx_decoders_xds.c b/src/lib_ccx/ccx_decoders_xds.c index 2ddc43ff..c90f5f4a 100644 --- a/src/lib_ccx/ccx_decoders_xds.c +++ b/src/lib_ccx/ccx_decoders_xds.c @@ -721,9 +721,7 @@ int xds_do_current_and_future (struct cc_subtitle *sub, struct ccx_decoders_xds_ ar_end = 262 - (ctx->cur_xds_payload[3] & 0x1F); unsigned active_picture_height = ar_end - ar_start; float aspect_ratio = (float) 320 / active_picture_height; - - /* ctx->current_ar_start */ - + if (ar_start != ctx->current_ar_start) { ctx->current_ar_start = ar_start; From 74c1d6d30dac31d1d7988ada4fae1f1716c5bafb Mon Sep 17 00:00:00 2001 From: Shruti Date: Tue, 10 May 2016 19:55:47 +0530 Subject: [PATCH 3/3] Fixes #354 : Excessive XDS notices --- src/lib_ccx/ccx_decoders_xds.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib_ccx/ccx_decoders_xds.c b/src/lib_ccx/ccx_decoders_xds.c index c90f5f4a..f6f4a077 100644 --- a/src/lib_ccx/ccx_decoders_xds.c +++ b/src/lib_ccx/ccx_decoders_xds.c @@ -716,12 +716,11 @@ int xds_do_current_and_future (struct cc_subtitle *sub, struct ccx_decoders_xds_ /* CEA-608-B: The starting line is computed by adding 22 to the decimal number represented by bits S0 to S5. The ending line is computing by substracting the decimal number represented by bits E0 to E5 from 262 */ - ar_start = (ctx->cur_xds_payload[2] & 0x1F) + 22; ar_end = 262 - (ctx->cur_xds_payload[3] & 0x1F); unsigned active_picture_height = ar_end - ar_start; float aspect_ratio = (float) 320 / active_picture_height; - + if (ar_start != ctx->current_ar_start) { ctx->current_ar_start = ar_start; @@ -736,7 +735,6 @@ int xds_do_current_and_future (struct cc_subtitle *sub, struct ccx_decoders_xds_ ccx_common_logging.debug_ftn(CCX_DMT_DECODER_XDS, "\rXDS Notice: Aspect ratio info, active picture height=%u, ratio=%f\n", active_picture_height, aspect_ratio); } - } case XDS_TYPE_PROGRAM_DESC_1: case XDS_TYPE_PROGRAM_DESC_2: