package com.vaguehope.morrigan.transcode;

import java.io.File;
import java.io.IOException;
import com.vaguehope.morrigan.util.LruCache;

public class FfprobeCache {

	private static final LruCache<String, FfprobeInfo> CACHE = new LruCache<String, FfprobeInfo>(10000);

	/**
	 * Will not return null.
	 */
	public static FfprobeInfo inspect (final File file) throws IOException {
		final String key = file.getAbsolutePath();
		FfprobeInfo info;
		synchronized (CACHE) {
			info = CACHE.get(key);
		}
		if (info != null && info.getFileLastModified() == file.lastModified()) {
			System.out.println("Using cached ffprobe info.");
			return info;
		}

		info = Ffprobe.inspect(file);

		synchronized (CACHE) {
			CACHE.put(key, info);
		}
		return info;
	}

}

@@ -572,61 +572,8 @@
 ) %7B%0A
-%09%09%09System.out.println(%22Using cached ffprobe info.%22);%0A
 %09%09%09r

Remove old System.out message.