mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-14 20:15:58 +08:00
国标推流一直打印 'Already existed a same track' (#3713)
https://github.com/ZLMediaKit/ZLMediaKit/pull/3689 https://github.com/ZLMediaKit/ZLMediaKit/issues/3702#issuecomment-2222326053
This commit is contained in:
@@ -85,6 +85,9 @@ DecoderImp::DecoderImp(const Decoder::Ptr &decoder, MediaSinkInterface *sink){
|
||||
#if defined(ENABLE_RTPPROXY) || defined(ENABLE_HLS)
|
||||
|
||||
void DecoderImp::onStream(int stream, int codecid, const void *extra, size_t bytes, int finish) {
|
||||
if (_finished) {
|
||||
return;
|
||||
}
|
||||
// G711传统只支持 8000/1/16的规格,FFmpeg貌似做了扩展,但是这里不管它了
|
||||
auto track = Factory::getTrackByCodecId(getCodecByMpegId(codecid), 8000, 1, 16);
|
||||
if (track) {
|
||||
@@ -92,6 +95,7 @@ void DecoderImp::onStream(int stream, int codecid, const void *extra, size_t byt
|
||||
}
|
||||
// 防止未获取视频track提前complete导致忽略后续视频的问题,用于兼容一些不太规范的ps流
|
||||
if (finish && _have_video) {
|
||||
_finished = true;
|
||||
_sink->addTrackCompleted();
|
||||
InfoL << "Add track finished";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user