Skip to content

Commit

Permalink
fix audio only stream finish reading too early
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Nov 9, 2014
1 parent 8e2cb09 commit fb9b119
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/AVDemuxThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,18 +380,18 @@ void AVDemuxThread::run()
aqueue->clear();
continue;
}
if (vqueue)
aqueue->blockFull(vqueue->isEnough() || demuxer->hasAttacedPicture());
// always block full if no vqueue because empty callback may set false
// attached picture is cover for song, 1 frame
aqueue->blockFull(!vqueue || (vqueue->isEnough() || demuxer->hasAttacedPicture()));
aqueue->put(pkt); //affect video_thread
}
} else if (index == video_stream) {
if (!video_thread || !video_thread->isRunning()) {
vqueue->clear();
continue;
}
if (vqueue) {
if (aqueue)
vqueue->blockFull(aqueue->isEnough());
if (!video_thread || !video_thread->isRunning()) {
vqueue->clear();
continue;
}
vqueue->blockFull(!aqueue || aqueue->isEnough());
vqueue->put(pkt); //affect audio_thread
}
} else { //subtitle
Expand Down

0 comments on commit fb9b119

Please sign in to comment.