Skip to content

Commit

Permalink
fix(channel): ready check
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Oct 11, 2023
1 parent 5dd02e7 commit b88615a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "channel/channel.hpp"

#include <future>
#include <chrono>
#include <cstdint>
#include <pipewire/pipewire.h>

Expand Down Expand Up @@ -29,6 +30,13 @@ namespace pipewire
return;
}

auto status = m_impl->source.wait_for(std::chrono::seconds(0));

if (status != std::future_status::ready)
{
return;
}

auto *source = m_impl->source.get();

if (source->fd < 0)
Expand Down

0 comments on commit b88615a

Please sign in to comment.