mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-03 00:47:34 +08:00
保证不丢帧
This commit is contained in:
@@ -223,13 +223,13 @@ public:
|
||||
* @param frame 数据帧
|
||||
*/
|
||||
void inputFrame(const Frame::Ptr &frame) override{
|
||||
if(_cfg.empty()){
|
||||
if (_cfg.empty()) {
|
||||
//未获取到aac_cfg信息
|
||||
if(frame->prefixSize() >= 7) {
|
||||
if (frame->prefixSize() >= 7) {
|
||||
//7个字节的adts头
|
||||
_cfg = makeAdtsConfig(reinterpret_cast<const uint8_t *>(frame->data()));
|
||||
_cfg = makeAdtsConfig((uint8_t *)(frame->data()));
|
||||
onReady();
|
||||
}else{
|
||||
} else {
|
||||
WarnL << "无法获取adts头!";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ void AACRtmpEncoder::inputFrame(const Frame::Ptr &frame) {
|
||||
if (_aac_cfg.empty()) {
|
||||
if (frame->prefixSize() >= 7) {
|
||||
//包含adts头,从adts头获取aac配置信息
|
||||
_aac_cfg = makeAdtsConfig(reinterpret_cast<const uint8_t *>(frame->data()));
|
||||
_aac_cfg = makeAdtsConfig((uint8_t *)(frame->data()));
|
||||
}
|
||||
makeConfigPacket();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user