mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 03:41:55 +00:00
fix the audio or video pid generate bug.
This commit is contained in:
parent
96f8f1f502
commit
03d951c0fb
1 changed files with 11 additions and 7 deletions
|
@ -771,17 +771,21 @@ SrsTsPacket* SrsTsPacket::create_pmt(SrsTsContext* context, int16_t pmt_number,
|
|||
pmt->last_section_number = 0;
|
||||
pmt->program_info_length = 0;
|
||||
|
||||
// if h.264 specified, use video to carry pcr.
|
||||
if (vs == SrsTsStreamVideoH264) {
|
||||
pmt->PCR_PID = vpid;
|
||||
pmt->infos.push_back(new SrsTsPayloadPMTESInfo(vs, vpid));
|
||||
} else if (as == SrsTsStreamAudioAAC || as == SrsTsStreamAudioMp3) {
|
||||
// must got one valid codec.
|
||||
srs_assert(vs == SrsTsStreamVideoH264 || as == SrsTsStreamAudioAAC || as == SrsTsStreamAudioMp3);
|
||||
|
||||
// if mp3 or aac specified, use audio to carry pcr.
|
||||
if (as == SrsTsStreamAudioAAC || as == SrsTsStreamAudioMp3) {
|
||||
// use audio to carray pcr by default.
|
||||
// for hls, there must be atleast one audio channel.
|
||||
pmt->PCR_PID = apid;
|
||||
pmt->infos.push_back(new SrsTsPayloadPMTESInfo(as, apid));
|
||||
} else {
|
||||
srs_assert(false);
|
||||
}
|
||||
|
||||
// if h.264 specified, use video to carry pcr.
|
||||
if (vs == SrsTsStreamVideoH264) {
|
||||
pmt->PCR_PID = vpid;
|
||||
pmt->infos.push_back(new SrsTsPayloadPMTESInfo(vs, vpid));
|
||||
}
|
||||
|
||||
pmt->CRC_32 = 0; // calc in encode.
|
||||
|
|
Loading…
Reference in a new issue