changeset 14571:512a57bbe68d

replaced bzero() with memset(); stream_type 0x0f is AAC
author nicodvb
date Sat, 22 Jan 2005 12:15:06 +0000
parents e64f14e1d279
children cfe2bbf96000
files libmpdemux/demux_ts.c
diffstat 1 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ts.c	Sat Jan 22 10:49:48 2005 +0000
+++ b/libmpdemux/demux_ts.c	Sat Jan 22 12:15:06 2005 +0000
@@ -475,7 +475,7 @@
 	req_spid = param->spid;
 
 	has_tables = 0;
-	bzero(pes_priv1, sizeof(pes_priv1));
+	memset(pes_priv1, 0, sizeof(pes_priv1));
 	init_pos = stream_tell(demuxer->stream);
 	mp_msg(MSGT_DEMUXER, MSGL_INFO, "PROBING UP TO %llu, PROG: %d\n", (uint64_t) param->probe, param->prog);
 	while((pos <= init_pos + param->probe) && (! demuxer->stream->eof))
@@ -1065,7 +1065,7 @@
 		uint32_t hdr, l = 0;
 
 		hdr = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
-		if((hdr & 0xfff00000) == 0xfff00000)
+		if(pes_is_aligned && ((hdr & 0xfff00000) == 0xfff00000))
 		{
 			// ADTS AAC shows with MPA layer 4 (00 in the layer bitstream)
 			l = 4 - ((hdr & 0x00060000) >> 17);
@@ -1079,8 +1079,7 @@
 		es->size    = packet_len;
 
 
-		//if((type_from_pmt == 0x0f) || (l == 4)) //see in parse_pmt()
-		if(l==4)
+		if((type_from_pmt == AUDIO_AAC) || (l == 4)) //see in parse_pmt()
 			es->type    = AUDIO_AAC;
 		else
 			es->type    = AUDIO_MP2;
@@ -1574,19 +1573,11 @@
 			case 0x10:
 				pmt->es[idx].type = VIDEO_MPEG4;
 				break;
+			case 0x0f:
 			case 0x11:
 				parse_descriptors(&pmt->es[idx], &es_base[5]);
 				pmt->es[idx].type = AUDIO_AAC;
 				break;
-
-			/*	seems to indicate an AAC in a certain broadcaster's tables, but
-				it's deceiving, so it's commented out
-			case 0x0f:
-				parse_descriptors(&pmt->es[idx], &es_base[5]);
-				pmt->es[idx].type = 0x0f;
-				break;
-			*/
-
 			case 0x1b:
 				pmt->es[idx].type = VIDEO_H264;
 				break;