Skip to content

Commit

Permalink
fix(HLSManager): fix logic of reading use index
Browse files Browse the repository at this point in the history
Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed Feb 28, 2020
1 parent 4487e82 commit 999299b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions framework/demuxer/play_list/HLSManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,22 @@ namespace Cicada {
if (i->mPFrame) {
if (pFrameOut == nullptr) {
pFrameOut = i->mPFrame.get();
} else if (i->mPFrame->getInfo().pts < pFrameOut->getInfo().pts) {
} else if (i->mPFrame->getInfo().dts < pFrameOut->getInfo().dts) {
pFrameOut = i->mPFrame.get();
}
}
}

if (index != -1) {
pFrameOut = nullptr;

for (auto &i : mStreamInfoList) {
if (i->mPFrame->getInfo().streamIndex == index) {
pFrameOut = i->mPFrame.get();
packet = move(i->mPFrame);
break;
if (i->mPStream->isOpened() && i->selected && i->mPFrame == nullptr && !i->eos) {
if (i->mPFrame->getInfo().streamIndex == index) {
pFrameOut = i->mPFrame.get();
packet = move(i->mPFrame);
break;
}
}
}
} else {
Expand Down

0 comments on commit 999299b

Please sign in to comment.