Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

避免对未成功获取(未初始化)的 AVPacket 进行释放 #52

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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