rendered paste body public void run() { String foo = LoadFile(Flansinserver); if (clipinfo.ClipIsImage(foo)) { System.out.println("We are image"); Flansinserver.setImageIcon(foo); } else { try { Process mediaplayer_process; long start = System.currentTimeMillis() / 1000; mediaplayer_process = new ProcessBuilder(mplayer_bin, " -fs ", RootPath + Clipname, " > c:\\out.txt").start(); System.out.println("Mplayer executed:" + mplayer_bin + " -fs " + RootPath + Clipname); mediaplayer_process.waitFor(); mediaplayer_process.destroy(); long stop = System.currentTimeMillis() / 1000; if ((stop - start) < 3) { System.err.println("Error playing ClipID " + clipinfo.CurrentClipID); System.err.println("Playing time: " + ( stop - start)) ; clipinfo.mark_clip_as_broken(clipinfo.CurrentClipID); } } catch(Exception e) { clipinfo.mark_clip_as_broken(clipinfo.CurrentClipID); System.out.println(e.getMessage()); LoadFile(Flansinserver); } } }