Title: [104858] trunk/Source/WebCore
Revision
104858
Author
[email protected]
Date
2012-01-12 14:13:35 -0800 (Thu, 12 Jan 2012)

Log Message

WebAudio: AudioBus::loadPlatformResource should mmap file on Mac port.
https://bugs.webkit.org/show_bug.cgi?id=74326

Reviewed by Darin Adler.

No new tests; no net change in functionality.

Use NSDataReadingMappedIfSafe when reading platform audio file data.

* platform/audio/mac/AudioBusMac.mm:
(WebCore::AudioBus::loadPlatformResource):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (104857 => 104858)


--- trunk/Source/WebCore/ChangeLog	2012-01-12 22:11:52 UTC (rev 104857)
+++ trunk/Source/WebCore/ChangeLog	2012-01-12 22:13:35 UTC (rev 104858)
@@ -1,5 +1,19 @@
 2011-12-12  Jer Noble  <[email protected]>
 
+        WebAudio: AudioBus::loadPlatformResource should mmap file on Mac port.
+        https://bugs.webkit.org/show_bug.cgi?id=74326
+
+        Reviewed by Darin Adler.
+
+        No new tests; no net change in functionality.
+
+        Use NSDataReadingMappedIfSafe when reading platform audio file data.
+
+        * platform/audio/mac/AudioBusMac.mm:
+        (WebCore::AudioBus::loadPlatformResource):
+
+2011-12-12  Jer Noble  <[email protected]>
+
         WebAudio: Use Logging instead of printf.
         https://bugs.webkit.org/show_bug.cgi?id=74322
 

Modified: trunk/Source/WebCore/platform/audio/mac/AudioBusMac.mm (104857 => 104858)


--- trunk/Source/WebCore/platform/audio/mac/AudioBusMac.mm	2012-01-12 22:11:52 UTC (rev 104857)
+++ trunk/Source/WebCore/platform/audio/mac/AudioBusMac.mm	2012-01-12 22:13:35 UTC (rev 104858)
@@ -47,8 +47,8 @@
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
     
     NSBundle *bundle = [NSBundle bundleForClass:[WebCoreAudioBundleClass class]];
-    NSString *audioFilePath = [bundle pathForResource:[NSString stringWithUTF8String:name] ofType:@"wav" inDirectory:@"audio"];
-    NSData *audioData = [NSData dataWithContentsOfFile:audioFilePath];
+    NSURL *audioFileURL = [bundle URLForResource:[NSString stringWithUTF8String:name] withExtension:@"wav" subdirectory:@"audio"];
+    NSData *audioData = [NSData dataWithContentsOfURL:audioFileURL options:NSDataReadingMappedIfSafe error:nil];
 
     if (audioData) {
         OwnPtr<AudioBus> bus(createBusFromInMemoryAudioFile([audioData bytes], [audioData length], false, sampleRate));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to