OS X Video freezes when executing a script
#1
I'm using an Apple Aluminum Remote to control almost every part of my Mac mini (with help of Remote Buddy, iRed 2, Keyboard Maestro).

I'm also controlling my AVR's volume usually by executing a little Applescript with Remote Buddy when pressing UP/DOWN on the remote.
The two scripts go like this:

Code:
tell application "iRed2" to perform action (Code "VOLMINUS" of Device "HK/RECEIVER")
and
Code:
tell application "iRed2" to perform action (Code "VOLPLUS" of Device "HK/RECEIVER")


Of course i only want to control the volume when watching a video, so i've edited my joystick.AppleRemote.xml like this:

Code:
<FullscreenVideo>
    <joystick name="AppleRemote">
      <button id="1">runscript(/Users/username/Library/Application Support/XBMC/userdata/scripts/VOLUP.applescript)</button>
      <button id="2">runscript(/Users/username/Library/Application Support/XBMC/userdata/scripts/VOLDOWN.applescript)</button>
      ........
      ........
    </joystick>
  </FullscreenVideo>


It works, but every time the script gets executed in the background there's a little freezing in the video playing.

Can someone tell me why this is happening and if there's a solution (except getting a universal remote or use the original Wink) ?

____________________________________________________________________________
OSX Version: 10.8.2
Platform: Mac mini (mid 2011), 2,3GHz i5, 8GB RAM, SSD
SVN Revision: XBMC 12.0 RC3

XBMC.log
Reply
#2
I have the same problem.

When executing an applescript (or python script) there's a noticable freeze in the video.

Any ideas why that is?

Ps. if the script is executed in the background by other means than the built-in XBMC function ( Runscript() ), the playing video doesn't freeze.
Reply
#3
It seems Tobias (PLEX Dev) maybe found a solution over here.

Quote:Well the problem is really obvious when looking at the code. The main thread will block until the script has finished. So the solution is to put the function Cocoa_DoAppleScriptFile() in a background thread.
Reply

Logout Mark Read Team Forum Stats Members Help
Video freezes when executing a script0