summaryrefslogtreecommitdiffstats
path: root/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libvideoeditor/lvpp/VideoEditorPreviewController.cpp')
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorPreviewController.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
index 830648a..180f75e 100755
--- a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
+++ b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
@@ -461,6 +461,13 @@ M4OSA_ERR VideoEditorPreviewController::startPreview(
mTarget = NULL;
}
+ // Create Audio player to be used for entire
+ // storyboard duration
+ mVEAudioSink = new VideoEditorPlayer::VeAudioOutput();
+ mVEAudioPlayer = new VideoEditorAudioPlayer(mVEAudioSink);
+ mVEAudioPlayer->setAudioMixSettings(mBackgroundAudioSetting);
+ mVEAudioPlayer->setAudioMixPCMFileHandle(mAudioMixPCMFileHandle);
+
LOGV("startPreview: loop = %d", loop);
mPreviewLooping = loop;
@@ -671,6 +678,12 @@ M4OSA_UInt32 VideoEditorPreviewController::stopPreview() {
mVePlayer[playerInst] = NULL;
}
}
+ LOGV("stopPreview: clear audioSink and audioPlayer");
+ mVEAudioSink.clear();
+ if (mVEAudioPlayer) {
+ delete mVEAudioPlayer;
+ mVEAudioPlayer = NULL;
+ }
// If image file playing, then free the buffer pointer
if(mFrameStr.pBuffer != M4OSA_NULL) {
@@ -972,6 +985,7 @@ M4OSA_ERR VideoEditorPreviewController::preparePlayer(
LOGV("preparePlayer: seekTo(%d)",
pController->mClipList[index]->uiBeginCutTime);
}
+ pController->mVePlayer[pController->mCurrentPlayer]->setAudioPlayer(pController->mVEAudioPlayer);
pController->mVePlayer[playerInstance]->readFirstVideoFrame();
LOGV("preparePlayer: readFirstVideoFrame of clip");