mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-26 03:42:21 +08:00
整理MediaSource派生类
修复转协议或录制时忽然Track的问题
This commit is contained in:
@@ -29,6 +29,21 @@
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
void RtmpDemuxer::loadMetaData(const AMFValue &val){
|
||||
try {
|
||||
makeVideoTrack(val["videocodecid"]);
|
||||
makeAudioTrack(val["audiocodecid"]);
|
||||
val.object_for_each([&](const string &key, const AMFValue &val) {
|
||||
if (key == "duration") {
|
||||
_fDuration = val.as_number();
|
||||
return;
|
||||
}
|
||||
});
|
||||
}catch (std::exception &ex){
|
||||
WarnL << ex.what();
|
||||
}
|
||||
}
|
||||
|
||||
bool RtmpDemuxer::inputRtmp(const RtmpPacket::Ptr &pkt) {
|
||||
switch (pkt->typeId) {
|
||||
case MSG_VIDEO: {
|
||||
|
||||
Reference in New Issue
Block a user