ljunkie / rarflix

Plex Roku Channel - original source from https://github.com/plexinc/roku-client-public
MIT License
117 stars 45 forks source link

BrightScript Debugger Fail in PhotoPlayerImageCanvas.brs(472) #218

Closed sa2000a closed 10 years ago

sa2000a commented 10 years ago

RARflix Dev 3.1.28 Error after shutting down PMS

Sorry I lost the console log - I had wrong filename syntax for telent capture and lost the log but i remember the following:

There was healthcheck text nearby on console log The exception was on line 472 of PhotoPlayerImageCanvas.brs

imageIsCurrent = m.lastImageEpoch-epochCheck

can't remember what it was. may be type mismatch. Sorry - cannot remember. It was silly of me to close the telnet window before seeing session piped logged file available

sa2000a commented 10 years ago

Ah ,,, it was still in the buffer - so here it is

OnTimerExpired:: slideshow popped BrightScript Micro Debugger. Enter any BrightScript statement, debug commands, or HELP. Current Function: 445: sub ICphotoPlayerOnTimerExpired(timer) 446: 447: if timer.Name = "HealthCheck" then 448: amountPlayed = m.playbackTimer.GetElapsedSeconds() 449: Debug("++HealthCheck:: PING! slideshow running for " + tostr(amountPlayed) + " seconds") 450: Debug("++HealthCheck:: idle time: " + tostr(m.idleTimer.GetElapsedSeconds()) + " seconds") 451: 452: ' Check to see if the slideshow is paused but should be active. The timer could have been deactivated 453: ' to complete a task (urlTransfer). We should cancel any pending requests as we would have reactivated 454: ' when we received a completed transfer (failure or success) but somehow didn't 455: if m.IsPaused = false and m.Timer.Active = false then 456: Debug("++HealthCheck:: cancel any pending requests and start fresh on screenID: " + tostr(m.screenID)) 457: GetViewController().CancelRequests(m.ScreenID) 458: Debug("++HealthCheck:: Reactivate slideshow timer") 459: m.Timer.Mark() 460: m.Timer.Active = true 461: end if 462: 463: end if 464: 465: if timer.Name = "slideshow" then 466: if m.context.count() > 1 then 467: Debug("ICphotoPlayerOnTimerExpired:: slideshow popped") 468: 469: ' check if we are over the IDLE time (keep the Roku NON idle if slideshow is playing) 470: if m.idleTimer.GetElapsedSeconds() > m.maxIdle then 471: epochCheck = getEpoch()-(m.slideshowPeriod+30) 472: imageIsCurrent = m.lastImageEpoch-epochCheck 473: 474: Debug("idle time popped: idle for " + tostr(m.idleTimer.GetElapsedSeconds()) + " seconds. Check if we need to reset what roku thinks is idle!") 475: 476: ' check if the last image is current. If not, we don't want to force a next button to reset the idle timer 477: if imageIsCurrent > 0 then 478: Debug("resetting idle time (will send a remote 'right' key to continue)") 479: Debug("last Successful Display: " + getLogDate(m.lastImageEpoch)) 480: SendEcpCommand("Right") 481: else 482: Debug("NOT resetting idle time: the slideshow hasn't displayed an image recently enough") 483: Debug(" last successful display: " + getLogDate(m.lastImageEpoch)) 484: Debug(" needed to be current: " + getLogDate(epochCheck)) 485: m.Next() 486: end if 487: else 488: m.Next() 489: end if 490: 491: end if 492: end if 493: 494: if timer.Name = "overlay" then 495: Debug("ICphotoPlayerOnTimerExpired:: overlay popped") 496: m.OverlayToggle("hide") 497: end if 498: 499: End Sub Type Mismatch. (runtime error &h18) in ...ce/PhotoPlayerImageCanvas.brs(472) 472: imageIsCurrent = m.lastImageEpoch-epochCheck Backtrace: Function icphotoplayerontimerexpired(timer As ) As file/line: /tmp/plugin/NAAAAA3IQMOz/pkg:/s...ce/PhotoPlayerImageCanvas.brs(472) Function vccontrol() As file/line: /tmp/plugin/NAAAAA3IQMOz/pkg:/source/ViewController.brs(1687) Function vcshow() As file/line: /tmp/plugin/NAAAAA3IQMOz/pkg:/source/ViewController.brs(1257) Function main(args As ) As file/line: /tmp/plugin/NAAAAA3IQMOz/pkg:/source/appMain.brs(76) Local Variables: timer &h4010 bsc:roAssociativeArray, refcnt=4 global &h0020 rotINTERFACE:ifGlobal m &h0010 bsc:roAssociativeArray, refcnt=6 amountplayed &h0000 val:Uninitialized epochcheck &h0002 Integer val:1392719526 imageiscurrent &h0000 val:Uninitialized BrightScript Debugger> Note: GC - Found 33650 orphaned objects (objects in a circular ref loop).

ljunkie commented 10 years ago

epochcheck: integer 1392719526 (good) so the only other variable here that must of failed was m.lastImageEpoch which is set to 0 at start and then only set to an epoch if an image was successful. I must be missing something. Still looking

ljunkie commented 10 years ago

Ugh, found it.. was setting the initial lastImageEpoch to the wrong object.

ljunkie commented 10 years ago

https://github.com/ljunkie/rarflix/commit/afd1f2268611a8e669eeec00b814e13b66c39345