aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/MediaInfo/FFMpegManager.cs')
-rw-r--r--MediaBrowser.Controller/MediaInfo/FFMpegManager.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs b/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs
index 5406b346c..111f5aff8 100644
--- a/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs
+++ b/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs
@@ -1,5 +1,4 @@
-using System.Collections.Generic;
-using MediaBrowser.Common.IO;
+using MediaBrowser.Common.IO;
using MediaBrowser.Common.MediaInfo;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
@@ -164,8 +163,16 @@ namespace MediaBrowser.Controller.MediaInfo
var success = true;
var changesMade = false;
+ var runtimeTicks = video.RunTimeTicks ?? 0;
+
foreach (var chapter in video.Chapters)
{
+ if (chapter.StartPositionTicks >= runtimeTicks)
+ {
+ _logger.Info("Stopping chapter extraction for {0} because a chapter was found with a position greater than the runtime.", video.Name);
+ break;
+ }
+
var filename = video.Id + "_" + video.DateModified.Ticks + "_" + chapter.StartPositionTicks;
var path = VideoImageCache.GetResourcePath(filename, ".jpg");