Scythe42's fixes for 1.4.0 (4 Viewers)

Status
Not open for further replies.

seco

Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    IMDB+ calls SaveCache() during initialization because it modified options of main MP and wants them to be saved immediately. This is an absolute no go! This method should never be called by any 3rd party stuff, unless it is something that explicitly modifies MediaPortal.xml settings (like the GUISettings plugin for example).

    Should SaveCache() be marked as an internal method then?
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    Regarding TV-Series:

    Bug in TV Series. Not thread safe usage of a Dictionary in a foreach loop that is used by more then one thread. The optionsCache seems to be TV Series thing only and not related to MP. Probably could be related to DBOptions in general. Maybe related to Trakt? Don't know, don't care. Just lock it as we are in a critical section here.

    Same problem is very likely in other plugins by the maintainer. But if fixed in one, it can be fixed in all.

    Here is what to do to fix it (if someone can report it to the maintainer, please):

    DBOptions.cs
    Code:
    private static readonly Object thisLock = new Object(); // put this where the rest of the private fields in the class are
     
    public static void LogOptions() {
      lock(thisLock)
      {
    	foreach (string key in optionsCache.Keys)
    	{
    	  // dont log private options
    	  if (!key.Equals(DBOption.cTraktPassword) && !key.Equals(DBOption.cOnlineUserID))
    	  {
    		MPTVSeriesLog.Write(string.Format("Option {0}: {1}", key, optionsCache[key].ToString()), MPTVSeriesLog.LogLevel.Debug);
    	  }
    	}
      }
    }

    PS: When it comes to locking. Never use lock(this) on a public method! Best is to never use lock(this) at all, unless you are sure what you are doing. Rule of thumb: always create an object for each lock on a critical section in your class.
     
    Last edited:

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,597
    10,590
    Königstein (Taunus)
    Home Country
    Germany Germany
    Just a small remark here to HomeY´s problems: I have no problems at all with any plugin, especially no probs with MP TV Series.
    All works like a charm, nothing special in logs ;)

    Add a log here with accessing MP TVSeries, playing an episode and closing MP again ;)
     
    Last edited:

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    Should SaveCache() be marked as an internal method then?
    Yes, should be internal in the future. Good idea maybe to log a Mantis issue here, so that this is not forgotton.
    0004377: SaveCache() should be marked as an internal method

    Not much info in that report, since i have no clue what you need in there, but assigned to you.
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    Just a small remark here to HomeY´s problems: I have no problems at all with any plugin, especially no probs with MP TV Series.
    All works like a charm, nothing special in logs ;)
    Yeah, rub it in! :D

    But... did you add:
    <entry name="threadedstartup">yes</entry>
    to your MediaPortal.xml (general section)?
     

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,597
    10,590
    Königstein (Taunus)
    Home Country
    Germany Germany
    But... did you add: yes to your MediaPortal.xml (general section)?
    I use the build from first post (no own compilation of GIT branch) where threading is automatic (w/o the possibility to switch it on/off within MP xml which I think was added to the GIT branch later) - so in fact I use threading ;)
     
    Last edited:

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    Just a small remark here to HomeY´s problems: I have no problems at all with any plugin, especially no probs with MP TV Series.
    I assume the HomeY's problem is related to the scrolling settings and their speed. This is not very well implemented. But will go away with a fontengine replacement anyway. That's why I asked for the MediaPortal.xml to check some stuff inside it in hope to reproduce it. What I would need to see is that the I find ways to reduce this "avg. framerate". It always shows my screen refresh rate. Scrolling is not smooth, but that is not relevant here.

    This frame limiting thing is broken. Instead of trying to limit frames for scrolling, the actually scrolling needs to be delayed still matching the refresh rate. 33fps on 50Hz will never work smooth. I probably just need to replace the calculations here with proper ones.

    I suspect by resetting some values, the problem goes away. But I first need to be able to reproduce the symptom HomeY is seeing.
     
    Last edited:

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Just a small remark here to HomeY´s problems: I have no problems at all with any plugin, especially no probs with MP TV Series.
    All works like a charm, nothing special in logs ;)

    Add a log here with accessing MP TVSeries, playing an episode and closing MP again ;)

    You need to rememeber that when it comes to threading related issues the issues are "random". With luck you dont see those issues even when they are present. It could be that with good luck the issues aren't reproduced since the CPU time slices are shared differently, threads get scheduled differently etc.
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    I made this change on purpose because to be frank: you want the UI displayed at 60Hz and only for content use a different RR.
    Why? I would say the UI should be rendered in the refresh rate that is current. My Setup runs at 50 Hz as I have most 50 Hz stuff here and this way avoid switching rr for the most part. MP should stick to what the user has Setup or have a selection itself, but not just say 60 Hz UI is best (for me it is not and I guess for most of Europe it is the same)...
     
    Status
    Not open for further replies.

    Users who are viewing this thread

    Top Bottom