diff recpt1/tssplitter_lite.c @ 104:afd25d9ebef6

output ECM packet so that former workaround is no longer needed.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 26 Feb 2010 22:55:44 +0900
parents 3f7288b0672c
children 12b9192becaa
line wrap: on
line diff
--- a/recpt1/tssplitter_lite.c	Fri Feb 26 19:46:03 2010 +0900
+++ b/recpt1/tssplitter_lite.c	Fri Feb 26 22:55:44 2010 +0900
@@ -596,6 +596,22 @@
 
 	N = ((buf[15] & 0x0F) << 4) + buf[16] + 16 + 1;
 
+	// ECM
+	int p = 17;
+	while(p < N) {
+		uint32_t ca_pid;
+		uint32_t tag;
+		uint32_t len;
+
+		tag = buf[p];
+		len = buf[p+1];
+		if(tag == 0x09 && len >= 4 && p+len <= N) {
+			ca_pid = ((buf[p+4] << 8) | buf[p+5]) & 0x1fff;
+			sp->pids[ca_pid] = 1;
+		}
+		p += len;
+	}
+
 	// ES PID
 	while (N < Nall + 8 - 4)
 	{