winlin

support aac_adtstoasc filter to copy mode.

... ... @@ -330,7 +330,8 @@ int SrsFFMPEG::start()
}
// the codec params is disabled when copy
if (acodec != SRS_RTMP_ENCODER_COPY && acodec != SRS_RTMP_ENCODER_NO_AUDIO) {
if (acodec != SRS_RTMP_ENCODER_NO_AUDIO) {
if (acodec != SRS_RTMP_ENCODER_COPY) {
params.push_back("-b:a");
snprintf(tmp, sizeof(tmp), "%d", abitrate * 1000);
params.push_back(tmp);
... ... @@ -344,7 +345,6 @@ int SrsFFMPEG::start()
params.push_back(tmp);
// aparams
if (!aparams.empty()) {
std::vector<std::string>::iterator it;
for (it = aparams.begin(); it != aparams.end(); ++it) {
std::string p = *it;
... ... @@ -352,6 +352,20 @@ int SrsFFMPEG::start()
params.push_back(p);
}
}
} else {
// for audio copy.
for (int i = 0; i < (int)aparams.size();) {
std::string pn = aparams[i++];
// aparams, the adts to asc filter "-bsf:a aac_adtstoasc"
if (pn == "-bsf:a" && i < (int)aparams.size()) {
std::string pv = aparams[i++];
if (pv == "aac_adtstoasc") {
params.push_back(pn);
params.push_back(pv);
}
}
}
}
}
... ...