[dvblast-devel] add ONID remapping

Christophe Massiot git at videolan.org
Fri Feb 5 16:12:31 CET 2016


dvblast | branch: master | Christophe Massiot <cmassiot at openheadend.tv> | Fri Feb  5 16:12:04 2016 +0100| [f377bf7816332aeb4a8cc0a111dcfd061e422e2d] | committer: Christophe Massiot

add ONID remapping

> http://git.videolan.org/gitweb.cgi/dvblast.git/?a=commit;h=f377bf7816332aeb4a8cc0a111dcfd061e422e2d
---

 demux.c   |   12 +++++++++---
 dvblast.c |    2 ++
 dvblast.h |    1 +
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/demux.c b/demux.c
index dea06f7..cc8bce9 100644
--- a/demux.c
+++ b/demux.c
@@ -1634,7 +1634,10 @@ static void NewNIT( output_t *p_output )
     p_ts = nit_get_ts( p, 0 );
     nitn_init( p_ts );
     nitn_set_tsid( p_ts, p_output->i_tsid );
-    nitn_set_onid( p_ts, p_output->config.i_network_id );
+    if ( p_output->config.i_onid )
+        nitn_set_onid( p_ts, p_output->config.i_onid );
+    else
+        nitn_set_onid( p_ts, p_output->config.i_network_id );
     nitn_set_desclength( p_ts, 0 );
 
     p_ts = nit_get_ts( p, 1 );
@@ -1685,8 +1688,11 @@ static void NewSDT( output_t *p_output )
     psi_set_current( p );
     psi_set_section( p, 0 );
     psi_set_lastsection( p, 0 );
-    sdt_set_onid( p,
-        sdt_get_onid( psi_table_get_section( pp_current_sdt_sections, 0 ) ) );
+    if ( p_output->config.i_onid )
+        sdt_set_onid( p, p_output->config.i_onid );
+    else
+        sdt_set_onid( p,
+            sdt_get_onid( psi_table_get_section( pp_current_sdt_sections, 0 ) ) );
 
     p_service = sdt_get_service( p, 0 );
     sdtn_init( p_service );
diff --git a/dvblast.c b/dvblast.c
index 38709dd..7e5fc67 100644
--- a/dvblast.c
+++ b/dvblast.c
@@ -313,6 +313,8 @@ static bool config_ParseHost( output_config_t *p_config, char *psz_string )
             p_config->i_if_index_v6 = strtol( ARG_OPTION("ifindex="), NULL, 0 );
         else if ( IS_OPTION("networkid=") )
             p_config->i_network_id = strtol( ARG_OPTION("networkid="), NULL, 0 );
+        else if ( IS_OPTION("onid=") )
+            p_config->i_onid = strtol( ARG_OPTION("onid="), NULL, 0 );
         else if ( IS_OPTION("networkname=")  )
         {
             config_strdvb( &p_config->network_name, ARG_OPTION("networkname=") );
diff --git a/dvblast.h b/dvblast.h
index f274eb3..e85d905 100644
--- a/dvblast.h
+++ b/dvblast.h
@@ -148,6 +148,7 @@ typedef struct output_config_t
     uint16_t *pi_pids;
     int i_nb_pids;
     uint16_t i_new_sid;
+    uint16_t i_onid;
     bool b_passthrough;
 
     /* for pidmap from config file */



More information about the dvblast-devel mailing list