Keep live decoding low latency and preserve publisher stop controls
This commit is contained in:
1 parent
b4ebaa8863
commit
7addfb5aa3
3 files changed
+4
-1
No files matched your search
@@ -243,6 +243,7 @@ void StreamPlayerWindow::decode() {
|
||||
if (!decoder) {
|
||||
const AVCodec* codec = avcodec_find_decoder(AV_CODEC_ID_H264);
|
||||
decoder = codec ? avcodec_alloc_context3(codec) : nullptr;
|
||||
if (decoder) { decoder->thread_count = 1; decoder->flags |= AV_CODEC_FLAG_LOW_DELAY; }
|
||||
if (!decoder || avcodec_open2(decoder, codec, nullptr) < 0) { fail(text("Stream video decoder failed")); break; }
|
||||
decoder->pkt_timebase = AVRational{1, 1000000};
|
||||
waitKey = false;
|
||||
|
||||
Reference in new issue
Block a user