mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-15 20:45:57 +08:00
解决单Track时,等待时间太长的问题
This commit is contained in:
@@ -28,6 +28,16 @@ PSDecoder::PSDecoder() {
|
||||
}
|
||||
return 0;
|
||||
},this);
|
||||
|
||||
ps_demuxer_notify_t notify = {
|
||||
[](void *param, int stream, int codecid, const void *extra, int bytes, int finish) {
|
||||
PSDecoder *thiz = (PSDecoder *) param;
|
||||
if (thiz->_on_stream) {
|
||||
thiz->_on_stream(stream, codecid, extra, bytes, finish);
|
||||
}
|
||||
}
|
||||
};
|
||||
ps_demuxer_set_notify((struct ps_demuxer_t *) _ps_demuxer, ¬ify, this);
|
||||
}
|
||||
|
||||
PSDecoder::~PSDecoder() {
|
||||
@@ -38,8 +48,12 @@ int PSDecoder::input(const uint8_t *data, int bytes) {
|
||||
return ps_demuxer_input((struct ps_demuxer_t*)_ps_demuxer,data,bytes);
|
||||
}
|
||||
|
||||
void PSDecoder::setOnDecode(const Decoder::onDecode &decode) {
|
||||
_on_decode = decode;
|
||||
void PSDecoder::setOnDecode(Decoder::onDecode cb) {
|
||||
_on_decode = std::move(cb);
|
||||
}
|
||||
|
||||
void PSDecoder::setOnStream(Decoder::onStream cb) {
|
||||
_on_stream = std::move(cb);
|
||||
}
|
||||
|
||||
}//namespace mediakit
|
||||
|
||||
Reference in New Issue
Block a user