[longomatch] Only create screenshots discovering files on request



commit 98354eae053a6ac1c9edb653372462c2fec2ee3e
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Apr 3 02:18:41 2013 +0200

    Only create screenshots discovering files on request

 LongoMatch.GUI/Gui/Dialog/VideoConversionTool.cs |    2 +-
 LongoMatch.Multimedia/Utils/PreviewMediaFile.cs  |   16 +++++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Dialog/VideoConversionTool.cs 
b/LongoMatch.GUI/Gui/Dialog/VideoConversionTool.cs
index bf6ef7e..47144c1 100644
--- a/LongoMatch.GUI/Gui/Dialog/VideoConversionTool.cs
+++ b/LongoMatch.GUI/Gui/Dialog/VideoConversionTool.cs
@@ -84,7 +84,7 @@ namespace LongoMatch.Gui.Dialog
                        List<string> errors = new List<string>();
                        foreach (string path in paths) {
                                try {
-                                       MediaFile file = PreviewMediaFile.DiscoverFile(path);
+                                       MediaFile file = PreviewMediaFile.DiscoverFile(path, false);
                                        store.AppendValues (file);
                                        Files.Add (file);
                                } catch (Exception) {
diff --git a/LongoMatch.Multimedia/Utils/PreviewMediaFile.cs b/LongoMatch.Multimedia/Utils/PreviewMediaFile.cs
index dd542b6..f78b78e 100644
--- a/LongoMatch.Multimedia/Utils/PreviewMediaFile.cs
+++ b/LongoMatch.Multimedia/Utils/PreviewMediaFile.cs
@@ -48,7 +48,7 @@ namespace LongoMatch.Video.Utils
                                                           out IntPtr audio_codec,
                                                           out IntPtr err);
                
-               public static MediaFile DiscoverFile(string filePath) {
+               public static MediaFile DiscoverFile(string filePath, bool takeScreenshot = true) {
                        long duration = 0;
                        uint width, height, fps_n, fps_d, par_n, par_d, ret, fps = 0;
                        string container, audio_codec, video_codec;
@@ -79,12 +79,14 @@ namespace LongoMatch.Video.Utils
                        if(has_video) {
                                fps = fps_n / fps_d;
                                par =  (float)par_n / par_d;
-                               factory = new MultimediaFactory ();
-                               thumbnailer = factory.GetFramesCapturer();
-                               thumbnailer.Open(filePath);
-                               thumbnailer.SeekTime(1000,false);
-                               preview = 
thumbnailer.GetCurrentFrame(THUMBNAIL_MAX_WIDTH,THUMBNAIL_MAX_HEIGHT);
-                               thumbnailer.Dispose();
+                               if(takeScreenshot) {
+                                       factory = new MultimediaFactory ();
+                                       thumbnailer = factory.GetFramesCapturer();
+                                       thumbnailer.Open(filePath);
+                                       thumbnailer.SeekTime(1000,false);
+                                       preview = 
thumbnailer.GetCurrentFrame(THUMBNAIL_MAX_WIDTH,THUMBNAIL_MAX_HEIGHT);
+                                       thumbnailer.Dispose();
+                               }
                        }
                        
                        return new LongoMatch.Store.MediaFile(filePath, duration, (ushort)fps, has_audio, 
has_video,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]