[dvblast-devel] demux: Fixed setting of provider and service name in SDT.
Georgi Chorbadzhiyski
git at videolan.org
Mon Sep 12 13:51:29 CEST 2011
dvblast | branch: master | Georgi Chorbadzhiyski <gf at unixsol.org> | Mon Sep 12 14:49:04 2011 +0300| [df2ab943b52908fd48bf9bb81e8ef2806d9cd8d2] | committer: 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.
> http://git.videolan.org/gitweb.cgi/dvblast.git/?a=commit;h=df2ab943b52908fd48bf9bb81e8ef2806d9cd8d2
---
demux.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/demux.c b/demux.c
index e1c8170..628ceec 100644
--- a/demux.c
+++ b/demux.c
@@ -1378,7 +1378,8 @@ static void NewSDT( output_t *p_output )
/* Regenerate descriptor 48 (service name) */
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_service = p_output->config.psz_service_name;
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 )
i_new_desc_len += i_old_service_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 {
/* Copy single descriptor */
int i_desc_len = DESC_HEADER_SIZE + desc_get_length( p_desc );
More information about the dvblast-devel
mailing list