Skip to content

Commit

Permalink
refactor(supermediaplayer): send dac msg before init demuxer
Browse files Browse the repository at this point in the history
Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed Aug 14, 2020
1 parent 6981c09 commit e520ebe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 11 additions & 5 deletions mediaPlayer/SuperMediaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1093,11 +1093,7 @@ int SuperMediaPlayer::mainService()
{
int64_t curTime = af_gettime_relative();
mUtil->notifyPlayerLoop(curTime);
string event = mDcaManager->getEvent();
while (!event.empty()) {
mPNotifier->NotifyEvent(MEDIA_PLAYER_EVENT_DIRECT_COMPONENT_MSG, event.c_str());
event = mDcaManager->getEvent();
}
sendDCAMessage();

if (mMessageControl->empty() || (0 == mMessageControl->processMsg())) {
ProcessVideoLoop();
Expand All @@ -1120,6 +1116,15 @@ int SuperMediaPlayer::mainService()
return 0;
}

void SuperMediaPlayer::sendDCAMessage()
{
string event = mDcaManager->getEvent();
while (!event.empty()) {
mPNotifier->NotifyEvent(MEDIA_PLAYER_EVENT_DIRECT_COMPONENT_MSG, event.c_str());
event = mDcaManager->getEvent();
}
}

void SuperMediaPlayer::ProcessVideoLoop()
{
int64_t curTime = af_gettime_relative() / 1000;
Expand Down Expand Up @@ -3443,6 +3448,7 @@ void SuperMediaPlayer::ProcessPrepareMsg()
mDemuxerService->getDemuxerHandle()->setDataSourceConfig(config);
}
mDcaManager->createObservers();
sendDCAMessage();
}

//step2: Demuxer init and getstream index
Expand Down
2 changes: 2 additions & 0 deletions mediaPlayer/SuperMediaPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ namespace Cicada {

void startRendering(bool start);

void sendDCAMessage();

int64_t mCheckAudioQueEOSTime{INT64_MIN};
uint64_t mAudioQueDuration{UINT64_MAX};

Expand Down

0 comments on commit e520ebe

Please sign in to comment.