mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2024-12-25 20:32:10 +00:00
Merge branch 'pr/n357_gshruti95'
This commit is contained in:
commit
bcfdda5f8d
@ -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;
|
||||
@ -716,8 +720,20 @@ 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;
|
||||
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);
|
||||
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user