write xds data only when option is passed

This commit is contained in:
Anshul Maheshwari 2014-07-19 18:15:53 +05:30
parent dc164f81e5
commit 47dbcdff9c

View File

@ -427,9 +427,12 @@ void xds_do_copy_generation_management_system (struct cc_subtitle *sub, unsigned
}
if (ccx_options.transcript_settings.xds)
{
xdsprint(sub, copy_permited);
xdsprint(sub, aps);
xdsprint(sub, rcd);
}
if (changed)
{
mprint ("\rXDS: %s\n",copy_permited);
@ -516,9 +519,12 @@ void xds_do_content_advisory (struct cc_subtitle *sub, unsigned c1, unsigned c2)
}
// Bits a1 and a0 determine the encoding. I'll add parsing as more samples become available
if (!a1 && a0) // US TV parental guidelines
{
if (ccx_options.transcript_settings.xds)
{
xdsprint(sub, age);
xdsprint(sub, content);
}
if (changed)
{
mprint ("\rXDS: %s\n ",age);
@ -531,6 +537,7 @@ void xds_do_content_advisory (struct cc_subtitle *sub, unsigned c1, unsigned c2)
(a0 && a1 && !Da2 && !La3) // Canadian English Language Rating
)
{
if (ccx_options.transcript_settings.xds)
xdsprint(sub, rating);
if (changed)
mprint ("\rXDS: %s\n ",rating);
@ -579,6 +586,7 @@ int xds_do_current_and_future (struct cc_subtitle *sub)
dbg_print(CCX_DMT_XDS, "PIN (Start Time): %s %02d-%02d %02d:%02d\n",
(cur_xds_packet_class==XDS_CLASS_CURRENT?"Current":"Future"),
date,month,hour,min);
if (ccx_options.transcript_settings.xds)
xdsprint (sub, "PIN (Start Time): %s %02d-%02d %02d:%02d\n",
(cur_xds_packet_class==XDS_CLASS_CURRENT?"Current":"Future"),
date,month,hour,min);
@ -605,6 +613,7 @@ int xds_do_current_and_future (struct cc_subtitle *sub)
else
dbg_print(CCX_DMT_XDS, "\rXDS: Program length (HH:MM): %02d:%02d ",hour,min);
if (ccx_options.transcript_settings.xds)
xdsprint(sub, "Program length (HH:MM): %02d:%02d ",hour,min);
if (cur_xds_payload_length>6) // Next two bytes (optional) available
@ -615,6 +624,7 @@ int xds_do_current_and_future (struct cc_subtitle *sub)
mprint ("Elapsed (HH:MM): %02d:%02d",el_hour,el_min);
else
dbg_print(CCX_DMT_XDS, "Elapsed (HH:MM): %02d:%02d",el_hour,el_min);
if (ccx_options.transcript_settings.xds)
xdsprint(sub, "Elapsed (HH:MM): %02d:%02d",el_hour,el_min);
}
@ -623,6 +633,7 @@ int xds_do_current_and_future (struct cc_subtitle *sub)
int el_sec=cur_xds_payload[6] & 0x3f; // 6 bits
if (!xds_program_length_shown)
dbg_print(CCX_DMT_XDS, ":%02d",el_sec);
if (ccx_options.transcript_settings.xds)
xdsprint(sub, "Elapsed (SS) :%02d",el_sec);
}
if (!xds_program_length_shown)
@ -641,6 +652,7 @@ int xds_do_current_and_future (struct cc_subtitle *sub)
xds_program_name[i-2]=cur_xds_payload[i];
xds_program_name[i-2]=0;
dbg_print(CCX_DMT_XDS, "\rXDS Program name: %s\n",xds_program_name);
if (ccx_options.transcript_settings.xds)
xdsprint(sub, "Program name: %s",xds_program_name);
if (cur_xds_packet_class==XDS_CLASS_CURRENT &&
strcmp (xds_program_name, current_xds_program_name)) // Change of program
@ -753,6 +765,7 @@ int xds_do_current_and_future (struct cc_subtitle *sub)
{
dbg_print(CCX_DMT_XDS, "\rXDS description line %d: %s\n",line_num,xds_desc);
}
if (ccx_options.transcript_settings.xds)
xdsprint(sub, "XDS description line %d: %s",line_num,xds_desc);
activity_xds_program_description (line_num, xds_desc);
}
@ -777,6 +790,7 @@ int xds_do_channel (struct cc_subtitle *sub)
xds_network_name[i-2]=cur_xds_payload[i];
xds_network_name[i-2]=0;
dbg_print(CCX_DMT_XDS, "XDS Network name: %s\n",xds_network_name);
if (ccx_options.transcript_settings.xds)
xdsprint (sub, "Network: %s",xds_network_name);
if (strcmp (xds_network_name, current_xds_network_name)) // Change of station
{
@ -797,6 +811,7 @@ int xds_do_channel (struct cc_subtitle *sub)
}
xds_call_letters[i-2]=0;
dbg_print(CCX_DMT_XDS, "XDS Network call letters: %s\n",xds_call_letters);
if (ccx_options.transcript_settings.xds)
xdsprint (sub, "Call Letters: %s",xds_call_letters);
if (strcmp (xds_call_letters, current_xds_call_letters)) // Change of station
{
@ -817,7 +832,7 @@ int xds_do_channel (struct cc_subtitle *sub)
unsigned b3=(cur_xds_payload[4])&0x10;
unsigned b4=(cur_xds_payload[5])&0x10;
unsigned tsid=(b4<<12) | (b3<<8) | (b2<<4) | b1;
if (tsid)
if (tsid && ccx_options.transcript_settings.xds)
xdsprint (sub, "TSID: %u",tsid);
break;
}
@ -936,6 +951,7 @@ void do_end_of_xds (struct cc_subtitle *sub, unsigned char expected_checksum)
case XDS_CLASS_PRIVATE: // CEA-608:
// The Private Data Class is for use in any closed system for whatever that
// system wishes. It shall not be defined by this standard now or in the future.
if (ccx_options.transcript_settings.xds)
was_proc=xds_do_private_data(sub);
break;
}