bangnoise / ofxHapPlayer

A Hap player for OpenFrameworks
Other
147 stars 46 forks source link

Need to indicate load() is ongoing during background load #32

Open rjx-ray opened 7 years ago

rjx-ray commented 7 years ago

I'm working for Igloovision on updating a Windows app from OF 8.4 to 9.7 We want to use ofxHapPlayer as the default player, but if the movie is non playable we try other players.

I've switched to the libavformat branch and have found that isLoaded() is no longer true immediately after calling load(), I'm guessing because the load happens in a new thread?

Can I find out somehow if the load is in progress and wait for a result? Is there any other way of testing whether the movie can be played or not?

bangnoise commented 7 years ago

Yep, loading happens in the background. This should be clearer, maybe we should add isLoading() or some such.

For the moment, if you have called load() and isLoaded() returns false and getError() returns an empty string, then you can assume it is loading. If you have called load() and getError() returns a non-empty string and isLoaded() returns false, then an error occurred during loading.

rjx-ray commented 7 years ago

Thanks for the quick response, I'll try your suggestion.

rjx-ray commented 7 years ago

Alternatively, is there any capability to test the codec type before attempting to load?