[MPlayer-cvslog] r20501 - trunk/libmpdemux/demux_ts.c

nicodvb subversion at mplayerhq.hu
Sun Oct 29 11:23:16 CET 2006


Author: nicodvb
Date: Sun Oct 29 11:23:15 2006
New Revision: 20501

Modified:
   trunk/libmpdemux/demux_ts.c

Log:
ts_parse() move section handling after stream_read() rather than repeating it

Modified: trunk/libmpdemux/demux_ts.c
==============================================================================
--- trunk/libmpdemux/demux_ts.c	(original)
+++ trunk/libmpdemux/demux_ts.c	Sun Oct 29 11:23:15 2006
@@ -2677,54 +2677,6 @@
 		//TABLE PARSING
 
 		base = priv->ts.packet_size - buf_size;
-		if(pid  == 0)
-		{
-			stream_read(stream,&packet[base], buf_size);
-			stream_skip(stream, junk);
-			parse_pat(priv, is_start, &packet[base], buf_size);
-			continue;
-		}
-		else if((tss->type == SL_SECTION) && pmt)
-		{
-			int k, ok=0, mp4_es_id = -1;
-			ts_section_t *section;
-			for(k = 0; k < pmt->mp4es_cnt; k++)
-			{
-				if(pmt->mp4es[k].decoder.object_type == MP4_OD && pmt->mp4es[k].decoder.stream_type == MP4_OD)
-					mp4_es_id = pmt->mp4es[k].id;
-			}
-			mp_msg(MSGT_DEMUX, MSGL_DBG2, "MP4ESID: %d\n", mp4_es_id);
-			for(k = 0; k < pmt->es_cnt; k++)
-			{
-				if(pmt->es[k].mp4_es_id == mp4_es_id)
-					ok = 1;
-			}
-			stream_read(stream,&packet[base], buf_size);
-			stream_skip(stream, junk);
-			if(ok)
-			{
-				section = &(tss->section);
-				parse_sl_section(pmt, section, progid, pid, is_start, &packet[base], buf_size);
-			}
-			continue;
-		}
-		else
-		{
-			progid = prog_id_in_pat(priv, pid);
-			if(progid != -1)
-			{
-				if(pid != demuxer->video->id && pid != demuxer->audio->id && pid != demuxer->sub->id)
-				{
-					stream_read(stream,&packet[base], buf_size);
-					stream_skip(stream, junk);
-					parse_pmt(priv, progid, pid, is_start, &packet[base], buf_size);
-					continue;
-				}
-				else
-					mp_msg(MSGT_DEMUX, MSGL_ERR, "Argh! Data pid %d used in the PMT, Skipping PMT parsing!\n", pid);
-			}
-		}
-
 
 		priv->last_pid = pid;
 
@@ -2861,7 +2813,7 @@
 		}
 
 
-		if(probe)
+		if(probe || !dp)	//dp is NULL for tables and sections
 		{
 			p = &packet[base];
 		}
@@ -2883,6 +2835,46 @@
 		}
 		stream_skip(stream, junk);
 
+		if(pid  == 0)
+		{
+			parse_pat(priv, is_start, p, buf_size);
+			continue;
+		}
+		else if((tss->type == SL_SECTION) && pmt)
+		{
+			int k, mp4_es_id = -1;
+			ts_section_t *section;
+			for(k = 0; k < pmt->mp4es_cnt; k++)
+			{
+				if(pmt->mp4es[k].decoder.object_type == MP4_OD && pmt->mp4es[k].decoder.stream_type == MP4_OD)
+					mp4_es_id = pmt->mp4es[k].id;
+			}
+			mp_msg(MSGT_DEMUX, MSGL_DBG2, "MP4ESID: %d\n", mp4_es_id);
+			for(k = 0; k < pmt->es_cnt; k++)
+			{
+				if(pmt->es[k].mp4_es_id == mp4_es_id)
+				{
+					section = &(tss->section);
+					parse_sl_section(pmt, section, progid, pid, is_start, &packet[base], buf_size);
+				}
+			}
+			continue;
+		}
+		else
+		{
+			progid = prog_id_in_pat(priv, pid);
+			if(progid != -1)
+			{
+				if(pid != demuxer->video->id && pid != demuxer->audio->id && pid != demuxer->sub->id)
+				{
+					parse_pmt(priv, progid, pid, is_start, &packet[base], buf_size);
+					continue;
+				}
+				else
+					mp_msg(MSGT_DEMUX, MSGL_ERR, "Argh! Data pid %d used in the PMT, Skipping PMT parsing!\n", pid);
+			}
+		}
+
 		if(is_start)
 		{
 			uint8_t *lang = NULL;



More information about the MPlayer-cvslog mailing list