From d2de2209715d87b1bbf4c61cb69dea1f5c92b901 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 25 Mar 2008 17:28:54 +0000 Subject: [PATCH] --- .../audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp b/src/juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp index d181e703bf..ae7f4f214d 100644 --- a/src/juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp +++ b/src/juce_appframework/audio/audio_file_formats/juce_QuickTimeAudioFormat.cpp @@ -64,6 +64,7 @@ BEGIN_JUCE_NAMESPACE #include "../../../juce_core/text/juce_LocalisedStrings.h" #include "../../../juce_core/threads/juce_Thread.h" #include "../../../juce_core/io/files/juce_FileInputStream.h" +#include "../../../juce_core/io/network/juce_URL.h" #define qtFormatName TRANS("QuickTime file") static const tchar* const extensions[] = { T(".mov"), T(".mp3"), 0 }; @@ -377,7 +378,11 @@ private: if (fin != 0) { - CFStringRef pathString = juceStringToCFString (T("file://") + fin->getFile().getFullPathName().replaceCharacter (T('\\'), T('/'))); + String path (fin->getFile().getFullPathName().replaceCharacter (T('\\'), T('/'))); + if (path.startsWithChar (T('/'))) + path = path.substring (1); + + CFStringRef pathString = juceStringToCFString (T("file://") + URL::addEscapeChars (path)); CFURLRef urlRef = CFURLCreateWithString (kCFAllocatorDefault, pathString, 0); CFRelease (pathString);