From e2e4e055979c46cda53e3a95c360e13464bdc0d6 Mon Sep 17 00:00:00 2001 From: Tim McIver Date: Fri, 5 Apr 2013 11:22:19 -0400 Subject: [PATCH] Changed the way problematic video files are tracked: now using a set of strings that are the file names of the bad video files rather than a set of the java.io.Files themselves. --- .../corecomponents/MediaViewVideoPanel.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewVideoPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewVideoPanel.java index 029898ecbf..0c48925985 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewVideoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewVideoPanel.java @@ -83,7 +83,7 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt private boolean autoTracking = false; // true if the slider is moving automatically private final Object playbinLock = new Object(); // lock for synchronization of gstPlaybin2 player private AbstractFile currentFile; - private Set badVideoFiles = Collections.synchronizedSet(new HashSet()); + private Set badVideoFiles = Collections.synchronizedSet(new HashSet()); /** * Creates new form MediaViewVideoPanel @@ -316,7 +316,7 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt } // throw exception if this file is known to be problematic - if (badVideoFiles.contains(file)) { + if (badVideoFiles.contains(file.getName())) { throw new Exception("Cannot capture frames from this file (" + file.getName() + ")."); } @@ -330,13 +330,13 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt StateChangeReturn ret = playbin.play(); if (ret == StateChangeReturn.FAILURE) { // add this file to the set of known bad ones - badVideoFiles.add(file); + badVideoFiles.add(file.getName()); throw new Exception("Problem with video file; problem when attempting to play while obtaining duration."); } ret = playbin.pause(); if (ret == StateChangeReturn.FAILURE) { // add this file to the set of known bad ones - badVideoFiles.add(file); + badVideoFiles.add(file.getName()); throw new Exception("Problem with video file; problem when attempting to pause while obtaining duration."); } playbin.getState(); @@ -362,7 +362,7 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt ret = playbin.pause(); if (ret == StateChangeReturn.FAILURE) { // add this file to the set of known bad ones - badVideoFiles.add(file); + badVideoFiles.add(file.getName()); throw new Exception("Problem with video file; problem when attempting to pause while capturing a frame."); } playbin.getState(); @@ -375,7 +375,7 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt ret = playbin.play(); if (ret == StateChangeReturn.FAILURE) { // add this file to the set of known bad ones - badVideoFiles.add(file); + badVideoFiles.add(file.getName()); throw new Exception("Problem with video file; problem when attempting to play while capturing a frame."); } @@ -392,13 +392,14 @@ public class MediaViewVideoPanel extends javax.swing.JPanel implements FrameCapt ret = playbin.stop(); if (ret == StateChangeReturn.FAILURE) { // add this file to the set of known bad ones - badVideoFiles.add(file); + badVideoFiles.add(file.getName()); throw new Exception("Problem with video file; problem when attempting to stop while capturing a frame."); } if (image == null) { logger.log(Level.WARNING, "There was a problem while trying to capture a frame from file " + file.getName()); - continue; + badVideoFiles.add(file.getName()); + break; } frames.add(new VideoFrame(image, timeStamp));