Skip to content

Commit

Permalink
Merge pull request wang-bin#1143 from jenglamlow/fix_black_frame
Browse files Browse the repository at this point in the history
Fix starting black frame by reorder thread init
  • Loading branch information
wang-bin authored Sep 27, 2018
2 parents 90de967 663c5f7 commit 7ddf6db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/AVPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1234,13 1234,14 @@ void AVPlayer::playInternal()
d->vthread->start();
}

d->read_thread->setMediaEndAction(mediaEndAction());
d->read_thread->start();

if (d->demuxer.audioCodecContext() && d->athread)
d->athread->waitForStarted();
if (d->demuxer.videoCodecContext() && d->vthread)
d->vthread->waitForStarted();

d->read_thread->setMediaEndAction(mediaEndAction());
d->read_thread->start();

/// demux thread not started, seek tasks will be cleared
d->read_thread->waitForStarted();
if (d->timer_id < 0) {
Expand Down

0 comments on commit 7ddf6db

Please sign in to comment.