完善兼容性

This commit is contained in:
xiongziliang 2019-08-30 16:56:57 +08:00
parent cfc7dc2126
commit 3c4d7498bc

View File

@ -156,10 +156,10 @@ public:
* @param aac_cfg aac两个字节的配置信息 * @param aac_cfg aac两个字节的配置信息
*/ */
AACTrack(const string &aac_cfg){ AACTrack(const string &aac_cfg){
if(aac_cfg.size() != 2){ if(aac_cfg.size() < 2){
throw std::invalid_argument("adts配置必须2个字节"); throw std::invalid_argument("adts配置必须最少2个字节");
} }
_cfg = aac_cfg; _cfg = aac_cfg.substr(0,2);
onReady(); onReady();
} }