[libdvbpsi-devel] how can i get the nit info

belle belle.shi at yy-inc.com
Thu Apr 28 07:58:01 CEST 2011


hi all:
   i download the libdvbpsi,and i change the decode_sdt.c in the
directory of examples like this:
  
the function NewSubtable:
if(i_table_id == 0x42)
  {
     printf("here is dvbpsi_AttachSDT\n");
    dvbpsi_AttachSDT(h_dvbpsi, i_table_id, i_extension, DumpSDT, NULL);
  }
+  else if(i_table_id == 0x40 || i_table_id == 0x41)
+  {
+    printf("here is dvbpsi_AttachNIT\n");
+     dvbpsi_AttachNIT( h_dvbpsi, i_table_id, i_extension,DumpNIT,NULL);
  }
--------------------------------------------------------------------------
the main fun:
+     nit_h_dvbpsi=dvbpsi_AttachDemux(NewSubtable, NULL);
      i_fd = open(pa_argv[1], 0);

      b_ok = ReadPacket(i_fd, data);
      while(b_ok)
      {
          uint16_t i_pid = ((uint16_t)(data[1] & 0x1f) << 8) + data[2];
         if(i_pid == 0x11)
          {
          dvbpsi_PushPacket(sdt_h_dvbpsi, data);
          }
+          else if(i_pid == 0x10)
+          {
+           printf("get nit packet\n");
+           dvbpsi_PushPacket(nit_h_dvbpsi, data);
+          }
+          b_ok = ReadPacket(i_fd, data);
+       }
      dvbpsi_DetachDemux(sdt_h_dvbpsi);
+     dvbpsi_DetachDemux(nit_h_dvbpsi);
-------------------------------------------------------------------------------
when i demux some ts file, i got the nit info ,but for some ts file,i
can't get the nit info, i can only saw the printf info of "here is
dvbpsi_AttachNIT",but it didn't call the DumpNIT, but when i used
another demux tool to parse the same ts file,it got the nit info,and
show no errors. so is there anyone also met the same question or can you
give some advise? 

    thanks for advance
    belle



More information about the libdvbpsi-devel mailing list