comparison libmpdemux/demux_ts.c @ 19537:45e1650f9ad5

don't try to autodetect aac in pes packets (the detection is prone to give wrong results); use the stream_type from the PMT instead
author nicodvb
date Sat, 26 Aug 2006 17:31:42 +0000
parents 8fc996a3b4e1
children 70a5e89ea4cd
comparison
equal deleted inserted replaced
19536:7dee65ac137e 19537:45e1650f9ad5
1423 return 1; 1423 return 1;
1424 } 1424 }
1425 } 1425 }
1426 else if ((stream_id & 0xe0) == 0xc0) 1426 else if ((stream_id & 0xe0) == 0xc0)
1427 { 1427 {
1428 int profile = 0, srate = 0, channels = 0;
1429 uint32_t hdr, l = 0;
1430
1431 hdr = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
1432 if(pes_is_aligned && ((hdr & 0xfff00000) == 0xfff00000))
1433 {
1434 // ADTS AAC shows with MPA layer 4 (00 in the layer bitstream)
1435 l = 4 - ((hdr & 0x00060000) >> 17);
1436 profile = ((hdr & 0x0000C000) >> 14);
1437 srate = ((hdr & 0x00003c00) >> 10);
1438 channels = ((hdr & 0x000001E0) >> 5);
1439 }
1440 mp_msg(MSGT_DEMUX, MSGL_DBG2, "\n\naudio header: %2X %2X %2X %2X\nLAYER: %d, PROFILE: %d, SRATE=%d, CHANNELS=%d\n\n", p[0], p[1], p[3], p[4], l, profile, srate, channels);
1441
1442 es->start = p; 1428 es->start = p;
1443 es->size = packet_len; 1429 es->size = packet_len;
1444 1430
1445 1431 if(type_from_pmt != UNKNOWN)
1446 if((type_from_pmt == AUDIO_AAC) || (l == 4)) //see in parse_pmt() 1432 es->type = type_from_pmt;
1447 es->type = AUDIO_AAC;
1448 else 1433 else
1449 es->type = AUDIO_MP2; 1434 es->type = AUDIO_MP2;
1450 1435
1451 es->payload_size -= packet_len; 1436 es->payload_size -= packet_len;
1452 1437