mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 21:14:01 +08:00
encoderd: remove unnecessary calls to encoder_close() on exit. (#28970)
This commit is contained in:
@@ -47,7 +47,7 @@ bool sync_encoders(EncoderdState *s, CameraType cam_type, uint32_t frame_id) {
|
||||
void encoder_thread(EncoderdState *s, const LogCameraInfo &cam_info) {
|
||||
util::set_thread_name(cam_info.thread_name);
|
||||
|
||||
std::vector<Encoder *> encoders;
|
||||
std::vector<std::unique_ptr<Encoder>> encoders;
|
||||
VisionIpcClient vipc_client = VisionIpcClient("camerad", cam_info.stream_type, false);
|
||||
|
||||
int cur_seg = 0;
|
||||
@@ -64,14 +64,11 @@ void encoder_thread(EncoderdState *s, const LogCameraInfo &cam_info) {
|
||||
assert(buf_info.width > 0 && buf_info.height > 0);
|
||||
|
||||
for (const auto &encoder_info : cam_info.encoder_infos) {
|
||||
encoders.push_back(new Encoder(encoder_info, buf_info.width, buf_info.height));
|
||||
auto &e = encoders.emplace_back(new Encoder(encoder_info, buf_info.width, buf_info.height));
|
||||
e->encoder_open(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < encoders.size(); ++i) {
|
||||
encoders[i]->encoder_open(NULL);
|
||||
}
|
||||
|
||||
bool lagging = false;
|
||||
while (!do_exit) {
|
||||
VisionIpcBufExtra extra;
|
||||
@@ -113,12 +110,6 @@ void encoder_thread(EncoderdState *s, const LogCameraInfo &cam_info) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG("encoder destroy");
|
||||
for (auto &e : encoders) {
|
||||
e->encoder_close();
|
||||
delete e;
|
||||
}
|
||||
}
|
||||
|
||||
template <size_t N>
|
||||
|
||||
Reference in New Issue
Block a user