Skip to content

Commit

Permalink
fix(ActiveDecoder): drop logic effective hevc only
Browse files Browse the repository at this point in the history
Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed Feb 14, 2020
1 parent 756b399 commit 5372c05
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions framework/codec/ActiveDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,15 @@ bool ActiveDecoder::needDrop(IAFPacket *packet)
if (packet == nullptr) {
return false;
}
if (packet->getInfo().flags & AF_PKT_FLAG_CORRUPT)

if (packet->getInfo().flags & AF_PKT_FLAG_CORRUPT) {
return true;
}

// TODO: make sure HEVC not need drop also
if (packet->getInfo().codec_id != AF_CODEC_ID_HEVC) {
return false;
}

if (bNeedKeyFrame) { // need a key frame, when first start or after seek
if ((packet->getInfo().flags & AF_PKT_FLAG_KEY) == 0) { // drop the frame that not a key frame
Expand Down Expand Up @@ -346,7 +353,6 @@ int ActiveDecoder::extract_decoder()
{
int count = 0;
int size;

{
std::unique_lock <std::mutex> uMutex(mMutex);
size = mOutputQueue.size();
Expand Down

0 comments on commit 5372c05

Please sign in to comment.