[vlc-commits] macosx: don't store playback position information for non-file URLs

Felix Paul Kühne git at videolan.org
Mon Jun 9 18:20:16 CEST 2014


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Jun  9 17:23:10 2014 +0200| [7e968781681a592e82ff9a3dd551262ce138c354] | committer: Felix Paul Kühne

macosx: don't store playback position information for non-file URLs

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7e968781681a592e82ff9a3dd551262ce138c354
---

 modules/gui/macosx/playlist.m |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index 6582642..c24db74 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -1537,12 +1537,19 @@
     if (!p_item)
         return;
 
-    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-    NSMutableDictionary *mutDict = [[NSMutableDictionary alloc] initWithDictionary:[defaults objectForKey:@"recentlyPlayedMedia"]];
-
     char *psz_url = decode_URI(input_item_GetURI(p_item));
     NSString *url = [NSString stringWithUTF8String:psz_url ? psz_url : ""];
     free(psz_url);
+
+    if (url.length < 1)
+        return;
+
+    if (![[NSURL URLWithString:url] isFileURL])
+        return;
+
+    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+    NSMutableDictionary *mutDict = [[NSMutableDictionary alloc] initWithDictionary:[defaults objectForKey:@"recentlyPlayedMedia"]];
+
     vlc_value_t pos;
     var_Get(p_input_thread, "position", &pos);
     float f_current_pos = 100. * pos.f_float;



More information about the vlc-commits mailing list