diff --git a/picard/musicdns/__init__.py b/picard/musicdns/__init__.py index d927c0f37..7c853f65e 100644 --- a/picard/musicdns/__init__.py +++ b/picard/musicdns/__init__.py @@ -17,8 +17,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -from picard.musicdns import ofa - +from picard.musicdns import ofa +from picard.util import encode_filename + _decoders = [] @@ -52,13 +53,14 @@ def init(tagger): def create_fingerprint(filename): """Decode the specified file and calculate a fingerprint.""" # TODO: init/done should be called only once, but the *must* be called - # from the same thread as we call decode. + # from the same thread as we call decode. + filename = encode_filename(filename) for decoder in _decoders: - decoder.init() + decoder.init() result = decoder.decode(filename) decoder.done() if result: - buffer, samples, sample_rate, stereo, duration = result + buffer, samples, sample_rate, stereo, duration = result fingerprint = ofa.create_print(buffer, samples, sample_rate, stereo) return (fingerprint, duration) return None