Skip to content

Commit

Permalink
Revert "fix: update duration when prepare"
Browse files Browse the repository at this point in the history
This reverts commit 5a74103.
  • Loading branch information
pingkai authored and I-m-SuperMan committed Feb 10, 2020
1 parent c27561c commit 38d3d85
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions mediaPlayer/SuperMediaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2801,6 +2801,10 @@ namespace Cicada {
return 0;
}

if (meta->duration > mDuration) {
mDuration = meta->duration;
}

//setVolume to current setting after create new.
SetVolume(mSet.mVolume);

Expand Down Expand Up @@ -3000,6 +3004,10 @@ namespace Cicada {
//
//#endif

if (meta->duration > mDuration) {
mDuration = meta->duration;
}

return ret;
}

Expand Down Expand Up @@ -3342,10 +3350,6 @@ namespace Cicada {
openStreamRet = mDemuxerService->OpenStream(i);
mCurrentVideoIndex = i;
mDemuxerService->GetStreamMeta(mCurrentVideoMeta, i, false);

if (meta->duration > mDuration) {
mDuration = meta->duration;
}
}
}
} else if (!mSet.bDisableAudio && meta->type == STREAM_TYPE_AUDIO) {
Expand All @@ -3368,10 +3372,6 @@ namespace Cicada {
AF_LOGD("get a audio stream\n");
openStreamRet = mDemuxerService->OpenStream(i);
mCurrentAudioIndex = i;

if (meta->duration > mDuration) {
mDuration = meta->duration;
}
}
} else if (meta->type == STREAM_TYPE_SUB) {
info->type = ST_TYPE_SUB;
Expand Down Expand Up @@ -3399,10 +3399,6 @@ namespace Cicada {
info->videoHeight = meta->height;
AF_LOGD("STREAM_TYPE_MIXED bandwidth is %llu", meta->bandwidth);

if (meta->duration > mDuration) {
mDuration = meta->duration;
}

if (mMainStreamId >= 0) {
AF_LOGD("already readed stream");
} else if (bandWidthNearStreamIndex == i) {
Expand Down

0 comments on commit 38d3d85

Please sign in to comment.