Commit 2c413e07 by xiongziliang

修复循环池导致的bug

parent 9f16cc12
......@@ -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);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论