Skip to content

Instantly share code, notes, and snippets.

@PhrantiK
Created July 20, 2024 18:40
Show Gist options
  • Save PhrantiK/3b2dcc59c5f340cd214cf474af988dfd to your computer and use it in GitHub Desktop.
Save PhrantiK/3b2dcc59c5f340cd214cf474af988dfd to your computer and use it in GitHub Desktop.
diff --git a/src/media.m b/src/media.m
index c9d6ac9..aef481f 100644
--- a/src/media.m
+++ b/src/media.m
@@ -115,9 +115,12 @@ - (void)media_change:(NSNotification *)notification {
if (!g_media_events) return;
MRMediaRemoteGetNowPlayingApplicationDisplayName(0, dispatch_get_main_queue(), ^(CFStringRef name) {
@autoreleasepool {
+
+ NSString* app = [(NSString*)CFBridgingRelease(name) copy];
+
MRMediaRemoteGetNowPlayingInfo(dispatch_get_main_queue(), ^(NSDictionary* dict) {
@autoreleasepool {
- if (dict && name) {
+ if (dict && app) {
NSString* app = (NSString*)name;
NSString* artist = [dict objectForKey:kMRMediaRemoteNowPlayingInfoArtist];
NSString* title = [dict objectForKey:kMRMediaRemoteNowPlayingInfoTitle];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment