fix window logic

This commit is contained in:
pigeatgarlic 2024-04-11 22:05:12 +07:00
parent 4fdda48259
commit ca801f1829
2 changed files with 8 additions and 7 deletions

View File

@ -95,7 +95,7 @@ func main() {
}
memory := (*C.SharedMemory)(unsafe.Pointer(pointer))
memory.queues[C.Video0].metadata.codec = C.int(1)
memory.queues[C.Video0].metadata.codec = C.int(0)
memory.queues[C.Video1].metadata.codec = C.int(0)
memory.queues[C.Audio].metadata.codec = C.int(3)
@ -135,7 +135,7 @@ func main() {
}(&memory.queues[queue_type], i)
}
fmt.Printf("execute sunshine with command : ./sunshine.exe \"%s\"\n", byteSliceToString(buffer))
fmt.Printf("execute sunshine with command : ./sunshine.exe \"%s\" 0\n", byteSliceToString(buffer))
chann := make(chan os.Signal, 16)
signal.Notify(chann, syscall.SIGTERM, os.Interrupt)
<-chann

View File

@ -144,11 +144,11 @@ main(int argc, char *argv[]) {
int queuetype = -1;
std::stringstream ss; ss << argv[2]; ss >> queuetype;
if ((queuetype != QueueType::Audio &&
queuetype != QueueType::Input) ||
video::probe_encoders()) {
BOOST_LOG(error) << "Video failed to find working encoder"sv;
return -1;
if(queuetype != QueueType::Audio && queuetype != QueueType::Input) {
if (video::probe_encoders()) {
BOOST_LOG(error) << "Video failed to find working encoder"sv;
return -1;
}
}
//Get buffer local address from handle
@ -254,6 +254,7 @@ main(int argc, char *argv[]) {
while (!process_shutdown_event->peek() && !local_shutdown->peek())
std::this_thread::sleep_for(1s);
BOOST_LOG(info) << "Closed" << queuetype;
// let other threads to close
std::this_thread::sleep_for(1s);
task_pool.stop();