v18 An awkward code question.
#1
Code:
int64_t CVideoReferenceClock::GetTime(bool interpolated /* = true*/)
    ...
    return CurrentHostCounter() + m_ClockOffset;
I add log find that m_ClockOffset is always changing, and can not find where the m_ClockOffset is changed.
There are only two places can change the m_ClockOffset in the source code.
1.void CVideoReferenceClock::Start()
But can only be run once.
2.void CVideoReferenceClock:Tonguerocess()
But is not run.

Who can tell me where the m_ClockOffset is changed?
Thanks!
Reply
#2
Thread moved to Kodi Application Development
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#3
Process() runs on a separate thread. Start() starts that thread.
Reply
#4
(2017-06-13, 09:56)DarrenHill Wrote: Thread moved to Kodi Application Development

Could you tell me where is the code?
Reply
#5
xbmc/thread/Thread.h is the base class
Reply
#6
(2017-06-13, 10:59)ironic_monkey Wrote: Process() runs on a separate thread. Start() starts that thread.

Process() is not run because I add log in it and no log was showing.
Reply
#7
then the cause is likely that you have not enabled sync to display. in ::Start it sets the reference value, THEN checks if it should start the thread. so you would see a changing value, just not very often, and it would not run Process(). in any case, crank out the debugger i will tell you exactly what is going on..
Reply
#8
(2017-06-13, 11:54)ironic_monkey Wrote: then the cause is likely that you have not enabled sync to display. in ::Start it sets the reference value, THEN checks if it should start the thread. so you would see a changing value, just not very often, and it would not run Process(). in any case, crank out the debugger i will tell you exactly what is going on..
I compiled the kodi to android apk.
How to crank out the debugger ?I add an ERROR level log in the Process()'s while ,it's not showing.But m_ClockOffset's value often change in the CVideoReferenceClock::GetTime(bool interpolated /* = true*/)
Reply
#9
Add a printout in the start method then?
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#10
You should be able to debug using eg ndk-gdb.
Reply
#11
(2017-06-14, 08:05)Memphiz Wrote: Add a printout in the start method then?

Code:
void CVideoReferenceClock::Start()
{
  CLog::LogF(LOGERROR, "CVideoReferenceClock::Start()-------------");
  m_ClockOffset = CurrentHostCounter();
  if(CServiceBroker::GetSettings().GetBool(CSettings::SETTING_VIDEOPLAYER_USEDISPLAYASCLOCK) && !IsRunning()){
      CLog::LogF(LOGERROR, "CVideoReferenceClock::create()-------------");
        Create();
  }
}
The above code , can only showing the "CVideoReferenceClock::Start()-------------" log,and no "CVideoReferenceClock::create()-------------" log.
Reply
#12
which means i perfectly described what happens above no?

Quote:then the cause is likely that you have not enabled sync to display. in ::Start it sets the reference value, THEN checks if it should start the thread. so you would see a changing value, just not very often, and it would not run Process().
Reply
#13
@ironic_monkey
Yes,the Process() is not running.
But the ::Start only run once.
But the m_ClockOffset's value often changs,so where changes it?

Code:
01-05 08:48:45.941 V/Kodi    ( 5266): Debug Print: GetTime: ------tclogkodi ----CVideoReferenceClock::GetTime--else----CurrentHostCounter---683975600------m_ClockOffset--667382372
01-05 08:48:45.945 V/Kodi    ( 5266): Debug Print: GetTime: ------tclogkodi ----CVideoReferenceClock::GetTime--else----CurrentHostCounter---683975600------m_ClockOffset--670915497
01-05 08:48:45.952 V/Kodi    ( 5266): Debug Print: GetTime: ------tclogkodi ----CVideoReferenceClock::GetTime--else----CurrentHostCounter---683975600------m_ClockOffset--677950548
01-05 08:48:45.952 V/Kodi    ( 5266): Debug Print: GetTime: ------tclogkodi ----CVideoReferenceClock::GetTime--else----CurrentHostCounter---683975600------m_ClockOffset--678126225
01-05 08:48:45.952 V/Kodi    ( 5266): Debug Print: GetTime: ------tclogkodi ----CVideoReferenceClock::GetTime--else----CurrentHostCounter---683975600------m_ClockOffset--678256069
01-05 08:48:45.960 V/Kodi    ( 5266): Debug Print: GetTime: ------tclogkodi ----CVideoReferenceClock::GetTime--else----CurrentHostCounter---683975600------m_ClockOffset--686588099
01-05 08:48:45.964 V/Kodi    ( 5266): Debug Print: GetTime: ------tclogkodi ----CVideoReferenceClock::GetTime--else----CurrentHostCounter---683975600------m_ClockOffset--690357630
01-05 08:48:45.964 V/Kodi    ( 5266): Debug Print: GetTime: ------tclogkodi ----CVideoReferenceClock::GetTime--else----CurrentHostCounter---683975600------m_ClockOffset--690439401
Reply
#14
Thats unusable please post your log snippets via pastebin.com - its totally screwed up with no line endings in tapatalk for example ...
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#15
@Memphiz
I am sorry the log is too large.I have put it on the google drive.
https://drive.google.com/file/d/0ByZyety...sp=sharing

Code:
01-08 06:28:45.190 V/Kodi    ( 4344): Debug Print: PrepareNextRender: -------tclogkodi -----CRenderManager::PrepareNextRender-------m_lateframes=551
From the log,I see that m_lateframes's value is 551.
So when I play a video is discontinuity,then I track to the m_ClockOffset's value as above.
Reply

Logout Mark Read Team Forum Stats Members Help
An awkward code question.0