Skip to content

Commit

Permalink
fix no seekFinished if pause before seek(wrong connection)
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Jun 10, 2015
1 parent f2275e0 commit 6c7dbb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/AVDemuxThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void AVDemuxThread::seekInternal(qint64 pos, SeekType type)
pauseInternal(false);
emit requestClockPause(false); // need direct connection
// direct connection is fine here
connect(watch_thread, SIGNAL(frameDelivered()), this, SLOT(frameDeliveredSeekOnPause()), Qt::DirectConnection);
connect(watch_thread, SIGNAL(seekFinished(qint64)), this, SLOT(seekOnPauseFinished()), Qt::DirectConnection);
}
}

Expand Down Expand Up @@ -332,11 +332,11 @@ void AVDemuxThread::nextFrame()
pauseInternal(false);
}

void AVDemuxThread::frameDeliveredSeekOnPause()
void AVDemuxThread::seekOnPauseFinished()
{
AVThread *thread = video_thread ? video_thread : audio_thread;
Q_ASSERT(thread);
disconnect(thread, SIGNAL(frameDelivered()), this, SLOT(frameDeliveredSeekOnPause()));
disconnect(thread, SIGNAL(seekFinished(qint64)), this, SLOT(seekOnPauseFinished()));
if (user_paused) {
pause(true); // restore pause state
emit requestClockPause(true); // need direct connection
Expand Down
2 changes: 1 addition & 1 deletion src/AVDemuxThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public slots:
void seekFinished(qint64 timestamp);

private slots:
void frameDeliveredSeekOnPause();
void seekOnPauseFinished();
void frameDeliveredNextFrame();
void onAVThreadQuit();

Expand Down

0 comments on commit 6c7dbb6

Please sign in to comment.