03-29-2012 10:37 AM
we're building an iOS app using the 2.1 media SDK. We often have the situation that the app crashes when trying to access a video that's still being transcoded, with the following crash message:
-[BCURLService release]: message sent to deallocated instance
This happens when calling the findVideoById:error: method of the BCMediaAPI instance, but not 100% reproducably. The call stack is as follows:
#2 0x00127eec in -[BCMediaService invokeJSONRequest:error:] (self=<value temporarily unavailable, due to optimizations>, _cmd=<value temporarily unavailable, due to optimizations>, jsonReqStr=<value temporarily unavailable, due to optimizations>, error=0xb3dcdec) at /Users/BUILD/server/work/aries/dev/iphonesdk/media
api/Classes/service/BCMediaService.m:135 #3 0x0012e40a in -[BCVideoReadService findVideoById:videoFields:customFields:error:] (self=<value temporarily unavailable, due to optimizations>, _cmd=<value temporarily unavailable, due to optimizations>, videoId=<value temporarily unavailable, due to optimizations>) at /Users/BUILD/server/work/aries/dev/iphonesdk/media api/Classes/service/BCVideoReadService.m:136 #4 0x0012e1d0 in -[BCVideoReadService findVideoById:error:] (self=<value temporarily unavailable, due to optimizations>, _cmd=<value temporarily unavailable, due to optimizations>, error=0xb3dcdec) at /Users/BUILD/server/work/aries/dev/iphonesdk/media api/Classes/service/BCVideoReadService.m:110 #5 0x00127126 in -[BCMediaAPI findVideoById:error:] (self=<value temporarily unavailable, due to optimizations>, _cmd=<value temporarily unavailable, due to optimizations>, error=0xb3dcdec) at /Users/BUILD/server/work/aries/dev/iphonesdk/media api/Classes/BCMediaAPI.m:165
I should note that we're linking against a version of the Brightcove library that has the SBJson symbols removed, because they were clashing with our own inclusion of that lib. But judging from the Obj-C exception, it sounds more like a retain-release bug in the Brightcove API.
We're using the BCMediaAPI as a singleton to avoid unneccessary alloc/init calls, and re-use it throughout the app. Might that be a problem?
03-29-2012 12:55 PM
Thanks a lot for the heads up. I'll open a bug so we can look at this. In the meantime, Would it be possible for you to attach a simplified XCode project where we can reproduce the issue? You can remove your API token, we would try it with one of our accounts and with a video that would currently transcoding. But in case there is a workaround for your current set up we could be faster providing it using your own code.
03-30-2012 04:16 AM
thanks for the reply. I did some more testing, and it turns out my original assumption was incorrect - the video being transcoded had nothing to do with it. Our modified library is also not the cause, nor the singleton usage of the API. But I'm now able to reproduce the crash with certainty. I was fetching the BCVideos in a background thread, and multiple videos in parallel - this causes the crash, in every case.
I've attached an extremely simple sample project demonstrating the crash. I hope it helps.
04-12-2012 03:28 PM
I was able to reproduce the crash and I might have a couple of suggestions but before that, I want to have a clear idea of what you are trying to achieve. It looks like what you care about is loading the videos while the app is loading without interrupting the app so that when the videos are done loading you can access them from some array or something. Is that correct?
The solution here might be to declare the Media API object just once, outside of the getVideo method and the same for the video variable and perhaps using a different method than using the performBackground API. But if you can share a little bit info about your design I can provide a more concrete solution.
12-18-2012 06:30 PM - edited 12-18-2012 06:31 PM
I'm seeing a similar issue when attempting to perform video retrieval using blocks, and am wondering what approach is recommended / supported by the Brightcove Team.
Alternatively, if there are known restrictions on using the Media API in a background thread, that would also be handy to have confirmed.
Any and all suggestions appreciated.
01-09-2013 04:39 PM
Are you using the older iOS SDK, or the new iOS Player SDK? The new and current version is the one available here:
If you are using this new iOS Player I would really recommend posting a new thread with some more details on any issues you're running into, as the architecture is totally different, and we can get some new eyes on it.