shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
238 stars 63 forks source link

Player crash on device #55

Closed Megubit closed 5 years ago

Megubit commented 5 years ago

I tried to build the latest version after issue #54 The build did pass without issues, however the player crashes when trying to play any content.

void Video::Play() {
  impl_->CallInnerMethod(&JSVideo::Play);  -> Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
}

And the sample_xcode_project when launching.

- (BOOL)getConfigurationBool:(const NSString *)namePath {
  auto results = _player->GetConfigurationBool(namePath.UTF8String);   ->Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
  if (results.has_error()) {
    return NO;
  } else {
    return results.results();
  }
}

At the same time I also updated xCode to Version 11.0, so I'm not sure if that could be the cause.

The old build I have from a month ago (02/09/2019) is working, so I wanted to try checking out the commit on which i built it and try making it again just in case the xCode update caused the issues, but I don't know which commit it is.

Megubit commented 5 years ago

Can confirm that it's not caused by xCode. I went trough commits and the last working one is 14d2f2d (tested without eme, since the fix for that is later on)

I'll use this version for now.

TheModMaker commented 5 years ago

If you are creating your own app using the C++ API, be sure to call Initialize() for each object before you use it. This includes initializing the video element before passing it to Player.

We changed the initialization recently for Objective-C. You can't just use init by itself anymore; you need to either use initWithClient or setClient to initialize the object. This ensures you can catch any errors that happen. It looks like we forgot to update one callsite in the sample project.

Megubit commented 5 years ago

I see. I did update the load function for the new block, but I missed this part :D. I will check how it's done in the sample project, that should be the safest way.

Thank you for the answer.