Skip to content

Commit

Permalink
Merge pull request #767 from comcloudway/next
Browse files Browse the repository at this point in the history
undid #740
  • Loading branch information
mpbraendli authored Dec 14, 2022
2 parents 8e1aba1 + 0652358 commit 6b69a78
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/welle-cli/webradiointerface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,20 +502,12 @@ bool WebRadioInterface::dispatch_client(Socket&& client)

const regex regex_mp3(R"(^[/]mp3[/]([^ ]+))");
std::smatch match_mp3;

const regex regex_mp3channel(R"(^[/]mp3-channel[/]([^ ]+)[/]([^ ]+))");
std::smatch match_mp3channel;

if (regex_search(req.url, match_mp3, regex_mp3)) {
success = send_mp3(s, match_mp3[1]);
}
else if (regex_search(req.url, match_slide, regex_slide)) {
success = send_slide(s, match_slide[1]);
}
else if (regex_search(req.url, match_mp3channel, regex_mp3channel)) {
retune(match_mp3channel[1]);
success = send_mp3(s, match_mp3channel[2]);
}
else {
cerr << "Could not understand GET request " << req.url << endl;
}
Expand Down Expand Up @@ -858,22 +850,6 @@ bool WebRadioInterface::send_mp3(Socket& s, const std::string& stream)
unique_lock<mutex> lock(rx_mut);
ASSERT_RX;

bool is_empty = true;
while (is_empty) {
for (const auto& srv : rx->getServiceList()) {
if (rx->serviceHasAudioComponent(srv) and
(to_hex(srv.serviceId, 4) == stream or
(uint32_t)std::stoul(stream) == srv.serviceId)) {
is_empty=false;

if (phs.count(srv.serviceId) == 0) {
WebProgrammeHandler ph(srv.serviceId);
phs.emplace(std::make_pair(srv.serviceId, move(ph)));
}
}
}
}

for (const auto& srv : rx->getServiceList()) {
if (rx->serviceHasAudioComponent(srv) and
(to_hex(srv.serviceId, 4) == stream or
Expand Down

0 comments on commit 6b69a78

Please sign in to comment.