OnDeviceChange crashing in 64-bit version (1 Viewer)

Anthony Vaughan

MP Donator
  • Premium Supporter
  • June 25, 2015
    633
    333
    Home Country
    United Kingdom United Kingdom
    Now that MediaPortal has gone 64-bit, any references to lParam should be converted to int64 rather than int32 or compared to zero without being converted.

    An example of this is the OnDeviceChange method in MediaPortal.cs where the following fails:

    if (msg.LParam.ToInt32() != 0)
    {

    The fix is to change this to:

    if (msg.LParam.ToInt64() != 0)
    {

    or

    if (msg.LParam != IntPtr.Zero)
    {

    There may be other places where this is happening but this example cropped up when I introduced a DVD player to my setup.

    Hope this helps.
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    633
    333
    Home Country
    United Kingdom United Kingdom
    Yes. It's not easy to spot them all.

    I expect many MP1 users don't switch to other so this wouldn't happen to them.

    I only came across this because I added DVD player to my setup and started to get log errors when switching between the MP1 laptop and the DVD player;).
     

    Anthony Vaughan

    MP Donator
  • Premium Supporter
  • June 25, 2015
    633
    333
    Home Country
    United Kingdom United Kingdom
    I have been using the following link to access the MP1 GIT HUB:


    This page doesn't reflect changes to sources after the final release is enacted. For example, it says the last change is 2 months ago.

    Is there a way to know that sources have been changed since a new release so I don't bother you unnecessarily?
     

    Users who are viewing this thread


    Write your reply...
    Top Bottom