[PATCH] Apple TV: fix erroneous out of free space error

Boris Golovnev <[email protected]>
Newsgroups gmane.comp.video.videolan.vlc.devel
Message-ID <CAAe2x3sBLp-j-+QoYWsnyTPKDZLGUuT5UoXKHJ3agnd1d0ymcw@mail.gmail.com>
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
https://mailman.videolan.org/listinfo/vlc-devel
patch.diff (application/octet-stream, 1.6 KB)
From 4aeee3e2569c2ea5c7ff908891a9447fa2e8576f Mon Sep 17 00:00:00 2001
From: Boris Golovnev <[email protected]>
Date: Fri, 15 Apr 2022 17:30:23 +0200
Subject: [PATCH] Apple TV: fix erroneous out of free space error

Checking for free space on tvOS when receiving a media file is not useful because a different model for storage is accepted on this platform. It is assumed that all of the device's storage is available for all apps at any time because none of it is permanent. As one app fills its container with data the system will delete files from other app's containers. Just writing data without checking if it fits is the right thing to do in this case.
---
 Sources/VLCHTTPConnection.m | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Sources/VLCHTTPConnection.m b/Sources/VLCHTTPConnection.m
index 01f2dfef..55bf785d 100644
--- a/Sources/VLCHTTPConnection.m
+++ b/Sources/VLCHTTPConnection.m
@@ -840,6 +840,7 @@ - (void)processStartOfPartWithHeader:(MultipartMessageHeader*) header
 
     _filepath = [uploadDirPath stringByAppendingPathComponent: filename];
 
+#ifndef TARGET_OS_TV
     NSNumber *freeSpace = [[UIDevice currentDevice] VLCFreeDiskSpace];
     if (_contentLength >= freeSpace.longLongValue) {
         /* avoid deadlock since we are on a background thread */
@@ -848,6 +849,7 @@ - (void)processStartOfPartWithHeader:(MultipartMessageHeader*) header
         [self stop];
         return;
     }
+#endif
 
     APLog(@"Saving file to %@", _filepath);
     if (![fileManager createDirectoryAtPath:[_filepath stringByDeletingLastPathComponent]
-- 
2.32.0 (Apple Git-132)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.