AAC RTMP/FLV input now ignore metadata and instead parse init data for channel count and sampling rate
This commit is contained in:
parent
19840f32d4
commit
28060d2113
2 changed files with 25 additions and 10 deletions
12
lib/adts.h
12
lib/adts.h
|
@ -58,7 +58,17 @@ namespace aac {
|
|||
bs.append(conf.data(), conf.size());
|
||||
if (bs.get(5) == 31){bs.skip(6);}// skip object type
|
||||
if (bs.get(4) == 15){bs.skip(24);}// frequency index
|
||||
return bs.get(4);//channel configuration
|
||||
uint8_t chanConfig = bs.get(4);
|
||||
if (chanConfig == 0){
|
||||
WARN_MSG("Unimplemented AAC AOT Specific Config parsing");
|
||||
return 8;
|
||||
}
|
||||
if (chanConfig > 7){
|
||||
WARN_MSG("Unimplemented AAC channel configuration %" PRIu8, chanConfig);
|
||||
return 8;
|
||||
}
|
||||
if (chanConfig == 7){return 8;}
|
||||
return chanConfig;
|
||||
}
|
||||
static inline uint8_t objtype(const std::string &conf){
|
||||
Utils::bitstream bs;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "rtmpchunks.h"
|
||||
#include "timing.h"
|
||||
#include "util.h"
|
||||
#include "adts.h"
|
||||
#include <fcntl.h> //for Tag::FileLoader
|
||||
#include <sstream>
|
||||
#include <stdio.h> //for Tag::FileLoader
|
||||
|
@ -890,6 +891,10 @@ void FLV::Tag::toMeta(DTSC::Meta &metadata, AMF::Object &amf_storage, unsigned i
|
|||
}else{
|
||||
metadata.tracks[reTrack].init = std::string((char *)data + 12, (size_t)len - 16);
|
||||
}
|
||||
if (metadata.tracks[reTrack].codec == "AAC"){
|
||||
metadata.tracks[reTrack].rate = aac::AudSpecConf::rate(metadata.tracks[reTrack].init);
|
||||
metadata.tracks[reTrack].channels = aac::AudSpecConf::channels(metadata.tracks[reTrack].init);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue