Moved Gst.init() call out of constructor because it was conflicting with other glib initialization on Linux which ultimately caused Autopsy to crash.

This commit is contained in:
esaunders 2019-09-25 17:30:05 -04:00
parent 379cfb9401
commit e5d71e419b

View File

@ -187,7 +187,6 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
*/
public MediaPlayerPanel() throws GstException, UnsatisfiedLinkError {
initComponents();
initGst();
customizeComponents();
}
@ -251,11 +250,6 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
};
}
private void initGst() throws GstException, UnsatisfiedLinkError {
logger.log(Level.INFO, "Attempting initializing of gstreamer for video/audio viewing"); //NON-NLS
Gst.init();
}
/**
* Loads the file by spawning off a background task to handle file copying
* and video component initializations.
@ -453,6 +447,12 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
if(this.isCancelled()) {
return;
}
// Initialize Gstreamer. It is safe to call this for every file.
// It was moved here from the constructor because having it happen
// earlier resulted in conflicts on Linux.
Gst.init();
//Video is ready for playback. Create new components
gstPlayBin = new PlayBin("VideoPlayer", tempFile.toURI());
//Configure event handling