aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-06-01 09:56:48 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-06-01 09:56:48 -0400
commit6accfc124dce10e475b1d22d1f7ea65cef46d32b (patch)
treeabda5b3397dbb0656d8929128225abb4f3756a9b /MediaBrowser.Controller/MediaInfo/FFMpegManager.cs
parentf82085b21e8ab19d7316876c365b01e61995ebc7 (diff)
fixes #321 - Chapter extraction (again)
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");