Skip to content

Commit

Permalink
Merge pull request #52 from pzhlkj6612/Flow_wrong_in_audio_decode_frame
Browse files Browse the repository at this point in the history
避免对未成功获取(未初始化)的 AVPacket 进行释放
  • Loading branch information
BensonLaur committed Feb 19, 2020
2 parents b745606 + df17e48 commit d399b0d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Entities/MusicPlayer/musicPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,18 @@ int PlayThread::audio_decode_frame(mediaState* MS, uint8_t* audio_buf)

int returns = -1; //除非音频解码成功返回音频数据,否则返回 -1

if (packet_queue_get(&MS->audioq, &packet, 0) < 0)
{
qDebug()<<"PlayThread::audio_decode_frame: no packet got";
return returns;
}


while (true)
{
if (packet_queue_get(&MS->audioq, &packet, 0) < 0)
{
break;
}
if (packet.pts == AV_NOPTS_VALUE)
{
// useless ?
break;
}

Expand Down

0 comments on commit d399b0d

Please sign in to comment.