Open tru opened 12 years ago
hey sorry just saw this. the cover art stuff is a bit of a disaster implementation wise. before i adapted their plugin i already had re-used and modified some of his code to get it working in my own way, i will have to dig back in to his framework and look at my implementation and then re-comment on it afterwards to refresh my memory on it.
I managed to solve it, by subclassing SMFMoviePreviewController and implementing my own refresh function (it's basically a copy and paste from SMFMoviePreviewController). The problem is that right now the current implementation doesn't work well with async loaded images from BRURLImageProxy. I changed the lines creating the previewControl to:
_previewControl =[[BRCoverArtPreviewControl alloc]init];
BRURLImageProxy *proxy = [_info objectForKey:kSMFMoviePreviewPoster];
[_previewControl setImageProxy:proxy];
[_previewControl setFrame:imageFrame];
[self addControl:_previewControl];
So that we could directly use the proxy in there. Then it worked of course.
In the Plex client we see this from time to time:
-[SMFBaseAsset coverArtURL]: unrecognized selector sent to instance 0x1144a8d0 1 libobjc.A.dylib 0x305491e5 objc_exception_throw + 32 2 CoreFoundation 0x340e1acb -[NSObject doesNotRecognizeSelector:] + 174 3 CoreFoundation 0x340e0945 _forwarding_ + 300 4 CoreFoundation 0x3403b680 _CF_forwarding_prep_0 + 48 5 AppleTV 0x330440f9 -[BRPhotoImageProxy imageForImageSize:] + 232 6 AppleTV 0x33063003 -[BRCoverArtPreviewControl setImageProxies:immedateLoad:] + 718 7 SMFramework 0x00387cc0 logFrame + 4960 8 plex 0x01c3ffe5 -[Plex_SMFMoviePreviewController reload] + 204 9 plex 0x01c38e1b __block_global_0 + 230 10 libdispatch.dylib 0x32bfaaff _dispatch_barrier_sync_f_slow_invoke + 78 11 libdispatch.dylib 0x32bf9e8d _dispatch_main_queue_callback_4CF$VARIANT$up + 196 12 CoreFoundation 0x340b12dd __CFRunLoopRun + 1268 13 CoreFoundation 0x340344dd CFRunLoopRunSpecific + 300 14 CoreFoundation 0x340343a5 CFRunLoopRunInMode + 104 15 AppleTV 0x33100c33 -[BRApplication(Private) _run] + 318 16 AppleTV 0x330ffbb3 BRApplicationMain + 642 17 AppleTV 0x0001c4ec AppleTV + 9452
Digging into the code it seems like you set a SMFBaseAsset to a BRPhotoImageProxy that expects the asset to implement coverArtURL in certain circumstances. Either that or we missuse the SMFramework API in some way. This crash seems to be highly random and doesn't always happen when you enter the MoviePreviewControl.
Any ideas?