Skip to content

Commit

Permalink
Score logging!
Browse files Browse the repository at this point in the history
  • Loading branch information
aassif committed Mar 13, 2019
1 parent 8f3ff6f commit 93eb4f9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Freebox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ bool Freebox::HTTP (const string & custom,

string response;
long http = freebox_http (custom, url, buffer.GetString (), &response, session);
XBMC->Log (LOG_DEBUG, "%s %s: %s", custom.c_str (), url.c_str (), response.c_str ());
XBMC->Log (LOG_DEBUG, "%s %s %s", custom.c_str (), url.c_str (), response.c_str ());

doc->Parse (response);

Expand Down Expand Up @@ -526,17 +526,24 @@ void Freebox::Channel::GetChannel (ADDON_HANDLE handle, bool radio) const
PVR->TransferChannelEntry (handle, &channel);
}

void freebox_debug_stream_properties (const string & url, int index, int score)
{
XBMC->Log (LOG_DEBUG, "GetStreamProperties: '%s' (index = %d, score = %d)", url.c_str (), index, score);
}

PVR_ERROR Freebox::Channel::GetStreamProperties (enum Source source, enum Quality quality,
PVR_NAMED_VALUE * properties, unsigned int * count) const
{
if (! streams.empty ())
{
int index = 0;
int score = streams[0].score (source, quality);
freebox_debug_stream_properties (streams[0].url, index, score);

for (size_t i = 1; i < streams.size (); ++i)
{
int s = streams[i].score (source, quality);
freebox_debug_stream_properties (streams[i].url, i, s);
if (s > score)
{
index = i;
Expand Down

0 comments on commit 93eb4f9

Please sign in to comment.