Big wait to stop a video since 1.1 final (1 Viewer)

WildParadise

Portal Member
May 8, 2008
49
4
Home Country
Canada Canada
Okay, i'll try fixing the database since doing a new database will takes hours and i'm pretty sure the end result will be the same.
I'll do that monday
 

Deda

Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    What I think it's not database problem but cache building problem and files count in checked as default shared folder in Configuration.

    Something like this:
    In config check shared folder with many video files. Start MP.

    Case 1 - You start with shared view, first load of files takes time if many files are there (cache is built for that folder), start some video there, it stops immediately.
    Switch to database view. Start video there, it stops immediately (because of existing already built cache)

    Case 2. You start with database view, it loads fast (no cache building), start video, stop takes time (no cache is built so MP builds default shared folder cache - this is a problem and it shouldn't do that here), then try again video, it stops fast

    Could you test this or this is the problem you have?
     

    WildParadise

    Portal Member
    May 8, 2008
    49
    4
    Home Country
    Canada Canada
    What I think it's not database problem but cache building problem and files count in checked as default shared folder in Configuration.

    Something like this:
    In config check shared folder with many video files. Start MP.

    Case 1 - You start with shared view, first load of files takes time if many files are there (cache is built for that folder), start some video there, it stops immediately.
    Switch to database view. Start video there, it stops immediately (because of existing already built cache)

    Case 2. You start with database view, it loads fast (no cache building), start video, stop takes time (no cache is built so MP builds default shared folder cache - this is a problem and it shouldn't do that here), then try again video, it stops fast

    Could you test this or this is the problem you have?

    I'm in case 2, I start with title view, I start some videos and it takes time to stop and after I dunno how much time it stops fast but it wasn't like that in the previous betas.

    If I do case 1, it goes as you say.

    I didn't got major increase of videos since the different betas and anyway I had a lot more movies than the other guy in the thread which as the same problem so it shouldn't be related.
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    Can you point in configuration default shared folder in some folder with small count of videos or in some empty folder and then start case 2 to see stop results (in my opinion stop should work then, but maybe I'm wrong so just to exclude that).

    I will also checked what is changed in betas before.
     

    WildParadise

    Portal Member
    May 8, 2008
    49
    4
    Home Country
    Canada Canada
    dunno if that is what you wanted but here's what I tried

    I've added a folder, I went in share view, went in the empty folder, exited media portal, started media portal, went in videos, it opened in the empty folder, pressed switch view to title, started a movie, stopped a movie (stopped right away), exited media portal, started media portal, went in videos, opened right in titles, started a movie, started a movie and it stopped right away.

    After that i restarted the computer to check if it would do it again, started media portal, went in videos, still in the title view, started a movie which took like 4 sec (not very long but longer), stopped and it stopped right away..

    Seems to be solved? Will test for a week and see.
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    You don't need to test anymore, i pinpoint the problem in the code (stack check loop) and I just needed confirmation.
    There is more than one problem, your case when directly goes to dbview it shouldn't rebuild cache from default share folder, and 2nd is creating cache and that stack loop which can really last long if there is many video files in folder.

    Temporary workaround is to point default share folder with small count of files but it's just a workaround, wee need to repair this.

    Code:
    [B]private void LoadDirectory(string newFolderName, bool useCache, IList<string> watchedFiles)[/B]
    .
    .
    .
                for (int x = 0; x < itemlist.Count; ++x)
                {
                  bool addItem = true;
                  GUIListItem item1 = itemlist[x];
                 [COLOR=Red] // This stack check causing big delay - needs rework
                  for (int y = 0; y < itemlist.Count; ++y)
                  {
                    GUIListItem item2 = itemlist[y];
                    if (x != y)
                    {
                      if (!item1.IsFolder || !item2.IsFolder)
                      {
                        if (!item1.IsRemote && !item2.IsRemote)
                        {
                          if (Util.Utils.ShouldStack(item1.Path, item2.Path))
                          {
                            if (String.Compare(item1.Path, item2.Path, true) > 0)
                            {
                              addItem = false;
                              // Update to reflect the stacked size
                              item2.FileInfo.Length += item1.FileInfo.Length;
                            }
                          }
                        }
                      }
                    }
                  }[/COLOR]
    
                  if (addItem)
                  {
                    string label = item1.Label;
                    if ((VirtualDirectory.IsValidExtension(item1.Path, Util.Utils.VideoExtensions, false)))
                    {
                      Util.Utils.RemoveStackEndings(ref label);
                    }
                    item1.Label = label;
                    itemfiltered.Add(item1);
                  }
                }
    .
    .
    .
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    I made some changes concerning this delay problem. Can you test My Videos with this file with your original setup which caused you a trouble, also try to navigate through folders in share view and see if there is speedup (especially folders where is many video files).

    (DLL file should go into MP Program folder/Plugins/Windows and don't forget to backup original).

    ** Replaced old file with new, minor bug removed if last files in sorted file list are stackable (can be joined in one)

    *** Removed old dll.
     

    WildParadise

    Portal Member
    May 8, 2008
    49
    4
    Home Country
    Canada Canada
    Hi, will test on monday, school after work tomorrow :)

    I only have one big folder though for the folders testing...
     

    Deda

    Lead Dev MP1 Videos
  • Premium Supporter
  • March 18, 2009
    2,423
    2,385
    Zagreb
    Home Country
    Croatia Croatia
    Fixed in SVN 26364 for 1.1.1. release (26365 1.2.0) HF
     

    Users who are viewing this thread

    Top Bottom