mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
parent
2f4cd67162
commit
9933398614
@ -205,6 +205,9 @@ Frame::Ptr Factory::getFrameFromPtr(CodecId codec, const char *data, size_t byte
|
||||
|
||||
Frame::Ptr Factory::getFrameFromBuffer(CodecId codec, Buffer::Ptr data, uint64_t dts, uint64_t pts) {
|
||||
auto frame = Factory::getFrameFromPtr(codec, data->data(), data->size(), dts, pts);
|
||||
if(!frame){
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_shared<FrameCacheAble>(frame, false, std::move(data));
|
||||
}
|
||||
|
||||
|
@ -110,6 +110,10 @@ void DecoderImp::onDecode(int stream, int codecid, int flags, int64_t pts, int64
|
||||
if (!ref.first) {
|
||||
onTrack(stream, Factory::getTrackByCodecId(codec, 8000, 1, 16));
|
||||
}
|
||||
if (!ref.first) {
|
||||
WarnL << "not support codec :" << getCodecName(codec);
|
||||
return;
|
||||
}
|
||||
auto frame = Factory::getFrameFromPtr(codec, (char *)data, bytes, dts, pts);
|
||||
if (getTrackType(codec) != TrackVideo) {
|
||||
onFrame(stream, frame);
|
||||
|
Loading…
Reference in New Issue
Block a user