[vlc-commits] macosx: don't try to resume playback if file was moved or deleted ( close #11644)

Felix Paul Kühne git at videolan.org
Sat Jul 12 19:44:24 CEST 2014


vlc/vlc-2.2 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sat Jul 12 15:17:10 2014 +0200| [0b56c932953902e1afbaeb87bffc21552c6cbf2c] | committer: Felix Paul Kühne

macosx: don't try to resume playback if file was moved or deleted (close #11644)

(cherry picked from commit 1de25564be9e214b73da76e1f7ebda6047c90413)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=0b56c932953902e1afbaeb87bffc21552c6cbf2c
---

 modules/gui/macosx/playlist.m |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index b4ef157..0e68a17 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -1493,9 +1493,16 @@
         }
 
         char *psz_url = decode_URI(input_item_GetURI(p_item));
+        if (!psz_url)
+            return;
+
         NSString *url = [NSString stringWithUTF8String:psz_url ? psz_url : ""];
         free(psz_url);
 
+        /* check for file existance before resuming */
+        if (![[NSFileManager defaultManager] fileExistsAtPath:[[NSURL URLWithString:[NSString stringWithUTF8String:input_item_GetURI(p_item)]] path]])
+            return;
+
         NSNumber *lastPosition = [recentlyPlayedFiles objectForKey:url];
         if (lastPosition && lastPosition.intValue > 0) {
             vlc_value_t pos;



More information about the vlc-commits mailing list