[webkit-reviews] review granted: [Bug 209341] Ensure media cache directory is created before passing to AVURLAsset. : [Attachment 394089] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Mar 20 09:28:33 PDT 2020
Eric Carlson <eric.carlson at apple.com> has granted Jer Noble
<jer.noble at apple.com>'s request for review:
Bug 209341: Ensure media cache directory is created before passing to
AVURLAsset.
https://bugs.webkit.org/show_bug.cgi?id=209341
Attachment 394089: Patch
https://bugs.webkit.org/attachment.cgi?id=394089&action=review
--- Comment #3 from Eric Carlson <eric.carlson at apple.com> ---
Comment on attachment 394089
--> https://bugs.webkit.org/attachment.cgi?id=394089
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=394089&action=review
>
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundati
onObjC.mm:850
> bool usePersistentCache = player()->shouldUsePersistentCache();
> [options setObject:@(!usePersistentCache)
forKey:AVURLAssetUsesNoPersistentCacheKey];
>
> - if (usePersistentCache)
> - [options
setObject:assetCacheForPath(player()->mediaCacheDirectory())
forKey:AVURLAssetCacheKey];
> + if (usePersistentCache) {
> + auto mediaCacheDirectory = player()->mediaCacheDirectory();
> + if (FileSystem::fileIsDirectory(mediaCacheDirectory,
ShouldFollowSymbolicLinks::Yes) ||
FileSystem::makeAllDirectories(mediaCacheDirectory))
> + [options setObject:assetCacheForPath(mediaCacheDirectory)
forKey:AVURLAssetCacheKey];
> + else
> + ASSERT_NOT_REACHED();
> + }
As we discussed, 'usePersistentCache' should be false if
'player()->mediaCacheDirectory()' is empty
More information about the webkit-reviews
mailing list