mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-18 22:32:22 +08:00
rtp send rtp g711 audio can config duration (#3325)
optimization for this [issue](https://github.com/ZLMediaKit/ZLMediaKit/issues/3316)
This commit is contained in:
@@ -34,6 +34,12 @@ bool RawEncoderImp::addTrack(const Track::Ptr &track) {
|
||||
auto ring = std::make_shared<RtpRing::RingType>();
|
||||
ring->setDelegate(std::make_shared<RingDelegateHelper>([this](RtpPacket::Ptr rtp, bool is_key) { onRTP(std::move(rtp), true); }));
|
||||
_rtp_encoder->setRtpRing(std::move(ring));
|
||||
if (track->getCodecId() == CodecG711A || track->getCodecId() == CodecG711U) {
|
||||
GET_CONFIG(uint32_t, dur_ms, RtpProxy::kRtpG711DurMs);
|
||||
Any param;
|
||||
param.set<uint32_t>(dur_ms);
|
||||
_rtp_encoder->setOpt(RtpCodec::RTP_ENCODER_PKT_DUR_MS, param);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user