Skip to content

Commit

Permalink
Fix UWP build error
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed Jul 22, 2023
1 parent 892132e commit 7559070
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion library/libpdr
Submodule libpdr updated 1 files
+6 −7 src/ssdp.cpp
22 changes: 11 additions & 11 deletions wiliwili/source/api/danmaku_live.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ LiveDanmaku::~LiveDanmaku() {
#endif
}

static void mongoose_event_handler(struct mg_connection *nc, int ev, void *ev_data, void *user_data);
static void mongoose_event_handler(struct mg_connection *nc, int ev,
void *ev_data, void *user_data);

static void heartbeat_timer(void *param) {
auto liveDanmaku = static_cast<LiveDanmaku *>(param);
if (liveDanmaku->is_connected() and liveDanmaku->is_evOK()) {
liveDanmaku->send_heartbeat();
}
}

void LiveDanmaku::connect(int room_id, int uid) {
if (connected.load(std::memory_order_acquire)) {
Expand Down Expand Up @@ -81,16 +89,8 @@ void LiveDanmaku::connect(int room_id, int uid) {
}
this->mongoose_mutex.unlock();

mg_timer_add(
this->mgr, 20000, MG_TIMER_REPEAT,
[](void *param) {
auto liveDanmaku = static_cast<LiveDanmaku *>(param);
if (liveDanmaku->is_connected() and
liveDanmaku->is_evOK()) {
liveDanmaku->send_heartbeat();
}
},
this);
mg_timer_add(this->mgr, 20000, MG_TIMER_REPEAT, heartbeat_timer,
this);
mg_mgr_poll(this->mgr, wait_time);
}
mg_mgr_free(this->mgr);
Expand Down

0 comments on commit 7559070

Please sign in to comment.