[vlc-commits] macosx: don't store playback position information for non-file URLs
Felix Paul Kühne
git at videolan.org
Mon Jun 9 17:23:40 CEST 2014
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Jun 9 17:23:10 2014 +0200| [1172ce6e5991ec63e72c40952ae8cafecc8fd177] | 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=1172ce6e5991ec63e72c40952ae8cafecc8fd177
---
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..9fb1d08 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