修正finish是true但track不支持,没有执行addTrackCompleted的问题 (#3689)

加快track类型不支持时媒体的注册速度
This commit is contained in:
zhang2349 2024-07-05 20:55:36 +08:00 committed by GitHub
parent 5b4ec8415d
commit 6c3d362b5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,10 +87,9 @@ DecoderImp::DecoderImp(const Decoder::Ptr &decoder, MediaSinkInterface *sink){
void DecoderImp::onStream(int stream, int codecid, const void *extra, size_t bytes, int finish) {
// G711传统只支持 8000/1/16的规格FFmpeg貌似做了扩展但是这里不管它了
auto track = Factory::getTrackByCodecId(getCodecByMpegId(codecid), 8000, 1, 16);
if (!track) {
return;
if (track) {
onTrack(stream, std::move(track));
}
onTrack(stream, std::move(track));
// 防止未获取视频track提前complete导致忽略后续视频的问题用于兼容一些不太规范的ps流
if (finish && _have_video) {
_sink->addTrackCompleted();