Index: Core/Player/g_player.cs
===================================================================
--- Core/Player/g_player.cs	(revision 27641)
+++ Core/Player/g_player.cs	(working copy)
@@ -98,6 +98,8 @@
     private static double[] _jumpPoints = null;
     private static bool _autoComSkip = false;
     private static bool _loadAutoComSkipSetting = true;
+    private static bool _reloadChapters = false;
+    private static long _chapterFileSize = 0;
 
     #endregion
 
@@ -2073,17 +2075,35 @@
             StepNow();
           }
         }
-        else if (_autoComSkip && _jumpPoints != null && _player.Speed == 1)
+        else if ( ( _autoComSkip ) && ( _player.Speed == 1 ) )
         {
-          double currentPos = _player.CurrentPosition;
-          foreach (double jumpFrom in _jumpPoints)
+          /*
+           * If chapters need to be reloaded, reload chapters
+           */
+          if (_reloadChapters)
           {
-            if (jumpFrom != 0 && currentPos <= jumpFrom + 1.0 && currentPos >= jumpFrom - 0.1)
+            string chapterFile = Path.ChangeExtension(_currentFilePlaying, ".txt");
+            long currentChapterFileSize = new System.IO.FileInfo(chapterFile).Length;
+
+            if (_chapterFileSize < currentChapterFileSize)
             {
-              Log.Debug("g_Player.Process() - Current Position: {0}, JumpPoint: {1}", currentPos, jumpFrom);
+              Log.Debug("g_Player.Process() - Chapter File has now grown to {0} bytes.", currentChapterFileSize);
+              LoadChapters(_currentFilePlaying);
+            }
+          }
 
-              JumpToNextChapter();
-              break;
+          if ( _jumpPoints != null )
+          {
+            double currentPos = _player.CurrentPosition;
+            foreach (double jumpFrom in _jumpPoints)
+            {
+              if (jumpFrom != 0 && currentPos <= jumpFrom + 1.0 && currentPos >= jumpFrom - 0.1)
+              {
+                Log.Debug("g_Player.Process() - Current Position: {0}, JumpPoint: {1}", currentPos, jumpFrom);
+
+                JumpToNextChapter();
+                break;
+              }
             }
           }
         }
@@ -2491,11 +2511,12 @@
     {
       _chapters = null;
       _jumpPoints = null;
+      _reloadChapters = false;
 
       try
       {
         string chapterFile = Path.ChangeExtension(videoFile, ".txt");
-        if (!File.Exists(chapterFile) || IsFileUsedbyAnotherProcess(chapterFile))
+        if (!File.Exists(chapterFile))
         {
           return false;
         }
@@ -2517,46 +2538,75 @@
         ArrayList chapters = new ArrayList();
         ArrayList jumps = new ArrayList();
 
-        using (StreamReader file = new StreamReader(chapterFile))
+        using (StreamReader file = new StreamReader(new FileStream(chapterFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
         {
+          Log.Warn("g_Player.LoadChapters() - opening Chapter File ({0}) attempting read-only access");
+
           string line = file.ReadLine();
 
+          /*
+           * When ComSkip has finished, the first line is the frames per second value, for some reasno *100
+           * */
           int fps;
+          double framesPerSecond;
           if (!int.TryParse(line.Substring(line.LastIndexOf(' ') + 1), out fps))
           {
-            Log.Warn("g_Player.LoadChapters() - Invalid chapter file \"{0}\"", chapterFile);
-            return false;
+            Log.Warn("g_Player.LoadChapters() - Incomplete chapter file \"{0}\"", chapterFile);
+            framesPerSecond = MediaInfo.Framerate;
+            Log.Warn("g_Player.LoadChapters() - Assuming framesPerSecond is {0}", framesPerSecond.ToString());
+            /*
+             * Do not read a line to retry parsing this line as a valid chapter marking
+             */
+            _reloadChapters = true;
+            _chapterFileSize = new FileInfo(chapterFile).Length;
+            Log.Debug("g_Player.LoadChapters() - Chapter File will refresh when it grows larger than {0} bytes.", _chapterFileSize);
           }
+          else
+          {
+            framesPerSecond = fps / 100.0;
+            /*
+             * Read the next line as a potentially valid chapter marking
+             */
+            line = file.ReadLine();
+          }
 
-          double framesPerSecond = fps / 100.0;
           int time;
 
-          while (!file.EndOfStream)
+          do
           {
-            line = file.ReadLine();
-            if (String.IsNullOrEmpty(line))
+            /*
+             * Parse each line in the file as a chapter in the format
+             * <jump>\t<chapter>
+             * 
+             * Where <jump> indicates the start of a commercial break, and 
+             * a jump to the next chapter should occur, and <chapter> indicates 
+             * the end of the commercial break, and the beginning of the 
+             * next chapter of the video
+             */
+            string[] tokens = line.Split(new char[] {'\t'});
+            if (tokens.Length == 2)
             {
-              continue;
-            }
+              if (int.TryParse(tokens[0], NumberStyles.Float, NumberFormatInfo.InvariantInfo, out time))
+              {
+                jumps.Add(time / framesPerSecond);
+              }
 
-            string[] tokens = line.Split(new char[] { '\t' });
-            if (tokens.Length != 2)
-            {
-              continue;
+              if (int.TryParse(tokens[1], NumberStyles.Float, NumberFormatInfo.InvariantInfo, out time))
+              {
+                chapters.Add(time / framesPerSecond);
+              }
             }
 
-            if (int.TryParse(tokens[0], NumberStyles.Float, NumberFormatInfo.InvariantInfo, out time))
+            do
             {
-              jumps.Add(time / framesPerSecond);
-            }
+              line = file.ReadLine();
+            } while ((String.IsNullOrEmpty(line)) && (!file.EndOfStream));
 
-            if (int.TryParse(tokens[1], NumberStyles.Float, NumberFormatInfo.InvariantInfo, out time))
-            {
-              chapters.Add(time / framesPerSecond);
-            }
-          }
+          } while (!String.IsNullOrEmpty(line));
         }
 
+        Log.Info("g_Player.LoadChapters() - Found {0} chapters", chapters.Count.ToString());
+
         if (chapters.Count == 0)
         {
           Log.Warn("g_Player.LoadChapters() - No chapters found in file \"{0}\"", chapterFile);
@@ -2571,6 +2621,8 @@
           jumps.CopyTo(_jumpPoints);
         }
 
+        Log.Info("g_Player.LoadChapters() - Updated {0} chapters", _chapters.Length.ToString() );
+
         return true;
       }
       catch (Exception ex)
