I wrote a new program to fix my problem with duplicate music files that’s somewhat handy; it uses GStreamer framework to decode a music or movie file, then uses the libfooid library to calculate a unique number based on the contents of a file. Why is this useful? Well, it means that if you converted half your library to M4A for example, you could find the old MP3 files and delete them off the disk. I’m going to write a Ruby script that’ll do just this in the next few days, but in the meantime here’s the program itself.
The program is pretty buggy like any other program I just throw together for my own use, it doesn’t handle errors very well. If you put it in a script, it returns 0 on success so you can use that to determine whether the output is a valid hash. Next, I’m going to try to optimize it using the liboil library, but unfortunately I can’t get oprofile to work on my machine so that’s definitely a thorn in my profiling side.