Disable reorder queue if doing encoding

pull/3825/merge
Isaac Connor 2024-11-23 13:37:32 -05:00
parent 65e098c35b
commit 1da0fa0af3
1 changed files with 7 additions and 2 deletions

View File

@ -148,7 +148,12 @@ bool VideoStore::open() {
} else { } else {
const AVDictionaryEntry *entry = av_dict_get(opts, "reorder_queue_size", nullptr, AV_DICT_MATCH_CASE); const AVDictionaryEntry *entry = av_dict_get(opts, "reorder_queue_size", nullptr, AV_DICT_MATCH_CASE);
if (entry) { if (entry) {
reorder_queue_size = std::stoul(entry->value); if (monitor->GetOptVideoWriter() == Monitor::ENCODE) {
Debug(1, "reorder_queue_size ignored for non-passthrough");
} else {
reorder_queue_size = std::stoul(entry->value);
Debug(1, "reorder_queue_size set to %zu", reorder_queue_size);
}
// remove it to prevent complaining later. // remove it to prevent complaining later.
av_dict_set(&opts, "reorder_queue_size", nullptr, AV_DICT_MATCH_CASE); av_dict_set(&opts, "reorder_queue_size", nullptr, AV_DICT_MATCH_CASE);
} else if (monitor->has_out_of_order_packets() } else if (monitor->has_out_of_order_packets()
@ -157,8 +162,8 @@ bool VideoStore::open() {
and monitor->GetOptVideoWriter() == Monitor::PASSTHROUGH and monitor->GetOptVideoWriter() == Monitor::PASSTHROUGH
) { ) {
reorder_queue_size = 2*monitor->get_max_keyframe_interval(); reorder_queue_size = 2*monitor->get_max_keyframe_interval();
Debug(1, "reorder_queue_size set to %zu", reorder_queue_size);
} }
Debug(1, "reorder_queue_size set to %zu", reorder_queue_size);
} }
oc->metadata = pmetadata; oc->metadata = pmetadata;