Skip to content

Commit

Permalink
Set default threads for nvdec to single thread
Browse files Browse the repository at this point in the history
  • Loading branch information
HolyWu committed Jul 1, 2023
1 parent 1cffbbf commit 6e08833
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/videosource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void LWVideoDecoder::OpenFile(const std::string &SourceFile, const std::string &
throw VideoException("Could not copy video codec parameters");

if (Threads < 1)
Threads = static_cast<int>(std::thread::hardware_concurrency());
Threads = (Type != AV_HWDEVICE_TYPE_CUDA) ? static_cast<int>(std::thread::hardware_concurrency()) : 1;
CodecContext->thread_count = Threads;

if (!VariableFormat) {
Expand Down

0 comments on commit 6e08833

Please sign in to comment.