--- /dev/null
+++ osdep/macosx_compat.m
@@ -0,0 +1,54 @@
+/*
+ * This file is part of mpv.
+ *
+ * mpv is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * mpv is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with mpv; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "osdep/macosx_compat.h"
+
+#if !defined (MAC_OS_X_VERSION_10_8) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8)
+
+@implementation NSArray (SubscriptingAdditions)
+- (id)objectAtIndexedSubscript:(NSUInteger)index
+{
+    return [self objectAtIndex:index];
+}
+@end
+
+@implementation NSMutableArray (SubscriptingAdditions)
+- (void)setObject:(id)object atIndexedSubscript:(NSUInteger)index
+{
+    if (index == [self count])
+        [self addObject:object];
+    else
+        [self replaceObjectAtIndex:index withObject:object];
+}
+@end
+
+@implementation  NSDictionary (SubscriptingAdditions)
+- (id)objectForKeyedSubscript:(id)key
+{
+    return [self objectForKey:key];
+}
+@end
+
+@implementation  NSMutableDictionary (SubscriptingAdditions)
+- (void)setObject:(id)object forKeyedSubscript:(id)key
+{
+    [self setObject:object forKey:key];
+}
+@end
+
+#endif
--- wscript_build.py.orig
+++ wscript_build.py
@@ -391,6 +391,7 @@ def build(ctx):
         ( "osdep/ar/HIDRemote.m",                "apple-remote" ),
         ( "osdep/macosx_application.m",          "cocoa" ),
         ( "osdep/macosx_events.m",               "cocoa" ),
+        ( "osdep/macosx_compat.m" ),
         ( "osdep/semaphore_osx.c" ),
         ( "osdep/subprocess.c" ),
         ( "osdep/subprocess-posix.c",            "posix-spawn" ),
