Commit df2ab943 authored by Georgi Chorbadzhiyski's avatar Georgi Chorbadzhiyski

demux: Fixed setting of provider and service name in SDT.

Commit 5967be13 introduced ability to change provider and service
name per output. Unfortunately the condition where SDT have more
than one descriptor and service name descriptor is not the first
one was not tested even if there were code to handle multiple
descriptors. With patch even if desc 0x48 is not the first one
everything works as expected.
parent f7be1f7b
...@@ -1378,7 +1378,8 @@ static void NewSDT( output_t *p_output ) ...@@ -1378,7 +1378,8 @@ static void NewSDT( output_t *p_output )
/* Regenerate descriptor 48 (service name) */ /* Regenerate descriptor 48 (service name) */
if ( desc_get_tag( p_desc ) == 0x48 && desc48_validate( p_desc ) ) if ( desc_get_tag( p_desc ) == 0x48 && desc48_validate( p_desc ) )
{ {
uint8_t i_old_provider_len, i_old_service_len, i_new_desc_len = 0; uint8_t i_old_provider_len, i_old_service_len;
uint8_t i_new_desc_len = 3; /* 1 byte - type, 1 byte provider_len, 1 byte service_len */
char *p_new_provider = p_output->config.psz_service_provider; char *p_new_provider = p_output->config.psz_service_provider;
char *p_new_service = p_output->config.psz_service_name; char *p_new_service = p_output->config.psz_service_name;
const uint8_t *p_old_provider = desc48_get_provider( p_desc, &i_old_provider_len ); const uint8_t *p_old_provider = desc48_get_provider( p_desc, &i_old_provider_len );
...@@ -1403,7 +1404,8 @@ static void NewSDT( output_t *p_output ) ...@@ -1403,7 +1404,8 @@ static void NewSDT( output_t *p_output )
i_new_desc_len += i_old_service_len; i_new_desc_len += i_old_service_len;
} }
desc_set_length( p_new_desc, i_new_desc_len ); desc_set_length( p_new_desc, i_new_desc_len );
i_total_desc_len += DESC48_HEADER_SIZE + 2 + i_new_desc_len; i_total_desc_len += DESC_HEADER_SIZE + i_new_desc_len;
p_new_desc += DESC_HEADER_SIZE + i_new_desc_len;
} else { } else {
/* Copy single descriptor */ /* Copy single descriptor */
int i_desc_len = DESC_HEADER_SIZE + desc_get_length( p_desc ); int i_desc_len = DESC_HEADER_SIZE + desc_get_length( p_desc );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment