Use threaded decoding in ffmpeg streaming.

This commit is contained in:
John Preston
2020-07-27 18:19:26 +04:00
parent e293a26029
commit 361b99b0c9
5 changed files with 11 additions and 6 deletions

View File

@@ -175,6 +175,7 @@ CodecPointer MakeCodecPointer(not_null<AVStream*> stream) {
return {};
}
av_codec_set_pkt_timebase(context, stream->time_base);
av_opt_set(context, "threads", "auto", 0);
av_opt_set_int(context, "refcounted_frames", 1, 0);
const auto codec = avcodec_find_decoder(context->codec_id);