Skip to content

Commit

Permalink
fix(SuperMediaPlayer): fix crash in setup av path
Browse files Browse the repository at this point in the history
make sure stream is opened before get meta

Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed Feb 6, 2020
1 parent d80917f commit cce5cd0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mediaPlayer/SuperMediaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2834,6 +2834,10 @@ namespace Cicada {

int SuperMediaPlayer::SetUpAudioPath()
{
if (mBufferController.IsPacketEmtpy(BUFFER_TYPE_AUDIO)) {
return 0;
}

unique_ptr<streamMeta> pMeta{};
mDemuxerService->GetStreamMeta(pMeta, mCurrentAudioIndex, false);
Stream_meta *meta = (Stream_meta *) (pMeta.get());
Expand Down Expand Up @@ -2884,6 +2888,10 @@ namespace Cicada {
return 0;
}

if (mBufferController.IsPacketEmtpy(BUFFER_TYPE_VIDEO)) {
return 0;
}

mDemuxerService->GetStreamMeta(mCurrentVideoMeta, mCurrentVideoIndex, false);
auto *meta = (Stream_meta *) (mCurrentVideoMeta.get());

Expand Down

0 comments on commit cce5cd0

Please sign in to comment.