mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 22:55:52 +08:00
修复循环池导致的bug
This commit is contained in:
parent
9f16cc1201
commit
2c413e0742
@ -64,6 +64,8 @@ void AACRtmpEncoder::inputFrame(const Frame::Ptr &frame) {
|
||||
|
||||
if(!_aac_cfg.empty()){
|
||||
RtmpPacket::Ptr rtmpPkt = ResourcePoolHelper<RtmpPacket>::obtainObj();
|
||||
rtmpPkt->strBuf.clear();
|
||||
|
||||
//////////header
|
||||
uint8_t is_config = false;
|
||||
rtmpPkt->strBuf.push_back(_ui8AudioFlags);
|
||||
@ -110,6 +112,8 @@ void AACRtmpEncoder::makeAudioConfigPkt() {
|
||||
_ui8AudioFlags = (flvAudioType << 4) | (flvSampleRate << 2) | (flvSampleBit << 1) | flvStereoOrMono;
|
||||
|
||||
RtmpPacket::Ptr rtmpPkt = ResourcePoolHelper<RtmpPacket>::obtainObj();
|
||||
rtmpPkt->strBuf.clear();
|
||||
|
||||
//////////header
|
||||
uint8_t is_config = true;
|
||||
rtmpPkt->strBuf.push_back(_ui8AudioFlags);
|
||||
|
@ -123,6 +123,8 @@ void H264RtmpEncoder::inputFrame(const Frame::Ptr &frame) {
|
||||
flags |= ((keyFrame ? FLV_KEY_FRAME : FLV_INTER_FRAME) << 4);
|
||||
|
||||
RtmpPacket::Ptr rtmpPkt = ResourcePoolHelper<RtmpPacket>::obtainObj();
|
||||
rtmpPkt->strBuf.clear();
|
||||
|
||||
rtmpPkt->strBuf.push_back(flags);
|
||||
rtmpPkt->strBuf.push_back(!is_config);
|
||||
rtmpPkt->strBuf.append("\x0\x0\x0", 3);
|
||||
@ -151,6 +153,8 @@ void H264RtmpEncoder::makeVideoConfigPkt() {
|
||||
bool is_config = true;
|
||||
|
||||
RtmpPacket::Ptr rtmpPkt = ResourcePoolHelper<RtmpPacket>::obtainObj();
|
||||
rtmpPkt->strBuf.clear();
|
||||
|
||||
//////////header
|
||||
rtmpPkt->strBuf.push_back(flags);
|
||||
rtmpPkt->strBuf.push_back(!is_config);
|
||||
|
Loading…
Reference in New Issue
Block a user