|
|
@@ -608,9 +608,8 @@ std::pair<std::unique_ptr<ui8 []>, si64> CAudioInstance::extractAudio(const Vide
|
|
|
bool CVideoPlayer::openAndPlayVideoImpl(const VideoPath & name, const Point & position, bool useOverlay, bool stopOnKey)
|
|
|
{
|
|
|
CVideoInstance instance;
|
|
|
- CAudioInstance audio;
|
|
|
|
|
|
- auto extractedAudio = audio.extractAudio(name);
|
|
|
+ auto extractedAudio = getAudio(name);
|
|
|
int audioHandle = CCS->soundh->playSound(extractedAudio);
|
|
|
|
|
|
if (!instance.openInput(name))
|
|
|
@@ -684,6 +683,15 @@ std::unique_ptr<IVideoInstance> CVideoPlayer::open(const VideoPath & name, float
|
|
|
|
|
|
std::pair<std::unique_ptr<ui8[]>, si64> CVideoPlayer::getAudio(const VideoPath & videoToOpen)
|
|
|
{
|
|
|
+ AudioPath audioPath = videoToOpen.toType<EResType::SOUND>();
|
|
|
+ AudioPath audioPathVideoDir = audioPath.addPrefix("VIDEO/");
|
|
|
+
|
|
|
+ if(CResourceHandler::get()->existsResource(audioPath))
|
|
|
+ return CResourceHandler::get()->load(audioPath)->readAll();
|
|
|
+
|
|
|
+ if(CResourceHandler::get()->existsResource(audioPathVideoDir))
|
|
|
+ return CResourceHandler::get()->load(audioPathVideoDir)->readAll();
|
|
|
+
|
|
|
CAudioInstance audio;
|
|
|
return audio.extractAudio(videoToOpen);
|
|
|
}
|