mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-01 07:22:23 +08:00
优化代码
除1024改成右移10位
This commit is contained in:
@@ -377,7 +377,7 @@ Sdp::Ptr AACTrack::getSdp(uint8_t payload_type) const {
|
||||
WarnL << getCodecName() << " Track未准备好";
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_shared<AACSdp>(getExtraData()->toString(), payload_type, getAudioSampleRate(), getAudioChannel(), getBitRate() / 1024);
|
||||
return std::make_shared<AACSdp>(getExtraData()->toString(), payload_type, getAudioSampleRate(), getAudioChannel(), getBitRate() >> 10);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -361,7 +361,7 @@ Sdp::Ptr H264Track::getSdp(uint8_t payload_type) const {
|
||||
WarnL << getCodecName() << " Track未准备好";
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_shared<H264Sdp>(_sps, _pps, payload_type, getBitRate() / 1024);
|
||||
return std::make_shared<H264Sdp>(_sps, _pps, payload_type, getBitRate() >> 10);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -267,7 +267,7 @@ Sdp::Ptr H265Track::getSdp(uint8_t payload_type) const {
|
||||
WarnL << getCodecName() << " Track未准备好";
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_shared<H265Sdp>(_vps, _sps, _pps, payload_type, getBitRate() / 1024);
|
||||
return std::make_shared<H265Sdp>(_vps, _sps, _pps, payload_type, getBitRate() >> 10);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -47,7 +47,7 @@ private:
|
||||
};
|
||||
|
||||
Sdp::Ptr JPEGTrack::getSdp(uint8_t) const {
|
||||
return std::make_shared<JPEGSdp>(getBitRate() / 1024);
|
||||
return std::make_shared<JPEGSdp>(getBitRate() >> 10);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ Sdp::Ptr L16Track::getSdp(uint8_t payload_type) const {
|
||||
WarnL << getCodecName() << " Track未准备好";
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_shared<L16Sdp>(payload_type, getAudioSampleRate(), getAudioChannel(), getBitRate() / 1024);
|
||||
return std::make_shared<L16Sdp>(payload_type, getAudioSampleRate(), getAudioChannel(), getBitRate() >> 10);
|
||||
}
|
||||
|
||||
Track::Ptr L16Track::clone() const {
|
||||
|
||||
@@ -62,7 +62,7 @@ Sdp::Ptr OpusTrack::getSdp(uint8_t payload_type) const {
|
||||
WarnL << getCodecName() << " Track未准备好";
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_shared<OpusSdp>(payload_type, getAudioSampleRate(), getAudioChannel(), getBitRate() / 1024);
|
||||
return std::make_shared<OpusSdp>(payload_type, getAudioSampleRate(), getAudioChannel(), getBitRate() >> 10);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
Reference in New Issue
Block a user