1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Generate timestamp only when transcode opus to aac.

This commit is contained in:
winlin 2020-06-16 13:39:02 +08:00
parent 2c1bd6da3e
commit cf738754ae
4 changed files with 6 additions and 7 deletions

View file

@ -424,6 +424,7 @@ SrsRtcFromRtmpBridger::SrsRtcFromRtmpBridger(SrsRtcSource* source)
discard_bframe = false;
merge_nalus = false;
meta = new SrsMetaCache();
audio_timestamp = 0;
}
SrsRtcFromRtmpBridger::~SrsRtcFromRtmpBridger()
@ -592,6 +593,10 @@ srs_error_t SrsRtcFromRtmpBridger::package_opus(char* data, int size, SrsRtpPack
SrsRtpPacket2* pkt = new SrsRtpPacket2();
pkt->frame_type = SrsFrameTypeAudio;
pkt->header.set_marker(true);
pkt->header.set_timestamp(audio_timestamp);
// TODO: FIXME: Why 960? Need Refactoring?
audio_timestamp += 960;
SrsRtpRawPayload* raw = new SrsRtpRawPayload();
pkt->payload = raw;