Merge pull request #5530 from dannysmyda/5888-Gstreamer-Crash-On-Autopsy

5888 Gstreamer crash on Windows
This commit is contained in:
Richard Cordovano 2020-01-02 10:24:36 -05:00 committed by GitHub
commit 838884da01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,6 +72,7 @@ import org.freedesktop.gstreamer.Format;
import org.freedesktop.gstreamer.GstException; import org.freedesktop.gstreamer.GstException;
import org.freedesktop.gstreamer.event.SeekFlags; import org.freedesktop.gstreamer.event.SeekFlags;
import org.freedesktop.gstreamer.event.SeekType; import org.freedesktop.gstreamer.event.SeekType;
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
/** /**
* This is a video player that is part of the Media View layered pane. It uses * This is a video player that is part of the Media View layered pane. It uses
@ -216,6 +217,14 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
//True for fairness. In other words, //True for fairness. In other words,
//acquire() calls are processed in order of invocation. //acquire() calls are processed in order of invocation.
sliderLock = new Semaphore(1, true); sliderLock = new Semaphore(1, true);
/**
* See JIRA-5888 for details. Initializing gstreamer here is more stable
* on Windows.
*/
if(PlatformUtil.isWindowsOS()) {
Gst.init();
}
} }
private void customizeComponents() { private void customizeComponents() {
@ -504,8 +513,10 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
// Initialize Gstreamer. It is safe to call this for every file. // Initialize Gstreamer. It is safe to call this for every file.
// It was moved here from the constructor because having it happen // It was moved here from the constructor because having it happen
// earlier resulted in conflicts on Linux. // earlier resulted in conflicts on Linux. See JIRA-5888.
Gst.init(); if(!PlatformUtil.isWindowsOS()) {
Gst.init();
}
//Video is ready for playback. Create new components //Video is ready for playback. Create new components
gstPlayBin = new PlayBin("VideoPlayer", tempFile.toURI()); gstPlayBin = new PlayBin("VideoPlayer", tempFile.toURI());