Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

[pvr.hts] replace with new implementation #399

Merged
merged 3 commits into from Jan 13, 2015

Conversation

Jalle19
Copy link
Collaborator

@Jalle19 Jalle19 commented Dec 31, 2014

@opdenkamp here it is. Haven't yet tested upgrading from a previous version, will push any changes as separate commits if I find anything. I also dropped all the translations since they need to be redone (the numbering needed changing and a bunch of strings related to transcoding are no longer used).

I left the change to mutex.h in a separate commit so it doesn't get lost in the main one. It is used by our AsyncState implementation.

The addon version is bumped to 2.0.0, and I've modified the authors line. I'm not sure whether your name should be first or last, you decide if I need to change that.

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jan 3, 2015

@adamsutton I'll need your help on this, I suck at this mutex stuff.

@opdenkamp
Copy link
Owner

@Jalle19 something like this:

typedef bool (*condition_predicate_callback)(void* param);

bool Wait(CMutex &mutex, condition_predicate_callback callback, void* param, uint32_t iTimeout)
{
  if (iTimeout == 0)
    return Wait(mutex, callback, param); //got to add this one too

  if (callback(param))
    return true;

  bool bReturn(false);
  bool bBreak(false);
  CTimeout timeout(iTimeout);
  uint32_t iMsLeft(0);

  while (!bReturn && !bBreak)
  {
    iMsLeft = timeout.TimeLeft();
    if ((bReturn = (callback(param)) == false && (bBreak = iMsLeft == 0) == false)
      m_condition.Wait(mutex.m_mutex, iMsLeft);
  }
  return bReturn;
}

@opdenkamp
Copy link
Owner

(and add an implementation of condition_predicate_callback that checks your condition)

@Jalle19 Jalle19 changed the title [pvr.hts] replace with new implemenation [pvr.hts] replace with new implementation Jan 3, 2015
@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jan 3, 2015

@opdenkamp seems to work. Will obviously need some history fixing.

@opdenkamp
Copy link
Owner

nice, will check asap. platform lib is used by more than just this
add-on (wrote it for libCEC originally)

Sam Stenvall schreef op 3-1-2015 om 12:50:

@opdenkamp https://github.com/opdenkamp seems to work. Will
obviously need some history fixing.


Reply to this email directly or view it on GitHub
#399 (comment).

@opdenkamp opdenkamp merged commit 6cde7ea into opdenkamp:master Jan 13, 2015
opdenkamp added a commit that referenced this pull request Jan 13, 2015
@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jan 22, 2015

@ksooo can you try the latest master? I screwed up last night and forgot a commit.

@ksooo
Copy link
Contributor

ksooo commented Jan 22, 2015

@Jalle19 #415 is definitely an improvement, but trying to understand whether this could fix the "deadlocks" I'm expiriencing. Can you point me to an actual bug it fixed (an actual call where * 1000 was forgotten in the code before your commit)?

@adamsutton can see an actual deadlock in the callstacks I provided or is it just some "looping" due to very short timeouts caused be the bug #415 fixed?

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jan 22, 2015

@ksooo without the latest commit (which is a combination of the commit I missed and a * 1000 statement I forgot to remove), AsyncState would use a timeout of 5000 * 1000 which means it will basically wait forever. I'm not sure if that's the culprit in your particular case though, trying to take a deeper look.

@ksooo
Copy link
Contributor

ksooo commented Jan 22, 2015

@Jalle19 Thanks for clarifying. Yes, this makes perfect sence. Especially, because behavior of Kodi felt like "deadlocked", but the callstacks I got didn't show me a classical deadlock situation. So, actually the deadlock seems to turn out as waiting "forever". Will try latest master later when I'm back home and report back then.

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jan 22, 2015

Okay, I hope it works because otherwise I'm pretty clueless.

@ksooo
Copy link
Contributor

ksooo commented Jan 25, 2015

@Jalle19 Turned out as a deadlock in tvheadend, was not related to pvr.hts v2.

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jan 25, 2015

@ksooo good to know

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants