diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index aee5ddb992..c44d0367a2 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -151,7 +151,11 @@ bool VideoStore::open() { reorder_queue_size = std::stoul(entry->value); // remove it to prevent complaining later. av_dict_set(&opts, "reorder_queue_size", nullptr, AV_DICT_MATCH_CASE); - } else if (monitor->has_out_of_order_packets() and !monitor->WallClockTimestamps()) { + } else if (monitor->has_out_of_order_packets() + and !monitor->WallClockTimestamps() + // Only sort packets for passthrough. Encoding uses wallclock by default + and monitor->GetOptVideoWriter() == Monitor::PASSTHROUGH + ) { reorder_queue_size = 2*monitor->get_max_keyframe_interval(); } Debug(1, "reorder_queue_size set to %zu", reorder_queue_size);