Skip to content

Commit

Permalink
fix(activedecoder): use AF_PKT_FLAG_KEY to detect a key frame
Browse files Browse the repository at this point in the history
Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed Sep 18, 2020
1 parent a02ac46 commit cd6df81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/codec/ActiveDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ bool ActiveDecoder::needDrop(IAFPacket *packet)
keyPts = packet->getInfo().pts;
return false;
}
} else if (packet->getInfo().flags) {
} else if (packet->getInfo().flags & AF_PKT_FLAG_KEY) {
keyPts = INT64_MIN;// get the next key frame, stop to check
}

Expand Down Expand Up @@ -219,7 +219,7 @@ int ActiveDecoder::thread_send_packet(unique_ptr<IAFPacket> &packet)
unique_lock<mutex> uMutex(mMutex);

if (bHolding) {
if (packet->getInfo().flags) {
if (packet->getInfo().flags & AF_PKT_FLAG_KEY) {
while (!mHoldingQueue.empty()) {
mHoldingQueue.pop();
}
Expand Down

0 comments on commit cd6df81

Please sign in to comment.