Skip to content

Commit

Permalink
Merge pull request wang-bin#1174 from ThatOdieGuy/seek-while-paused-fix
Browse files Browse the repository at this point in the history
fix seek updates video while paused
  • Loading branch information
wang-bin authored Dec 29, 2018
2 parents f26fbf0 3089aee commit 07277e5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/AVDemuxThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 213,6 @@ void AVDemuxThread::stepBackward()

void AVDemuxThread::seek(qint64 external_pos, qint64 pos, SeekType type)
{
end = false;
class SeekTask : public QRunnable {
public:
SeekTask(AVDemuxThread *dt, qint64 external_pos, qint64 t, SeekType st)
Expand All @@ -240,6 239,16 @@ void AVDemuxThread::seek(qint64 external_pos, qint64 pos, SeekType type)
qint64 position;
qint64 external_pos;
};

end = false;
// queue maybe blocked by put()
// These must be here or seeking while paused will not update the video frame
if (audio_thread) {
audio_thread->packetQueue()->clear();
}
if (video_thread) {
video_thread->packetQueue()->clear();
}
newSeekRequest(new SeekTask(this, external_pos, pos, type));
}

Expand Down

0 comments on commit 07277e5

Please sign in to comment.