ffmpegdecoder: run timer in main thread at all times

This commit is contained in:
itsmattkc
2020-02-24 11:56:48 +11:00
parent 08ed766771
commit 6239107670
+2 -1
View File
@@ -50,6 +50,7 @@ FFmpegDecoder::FFmpegDecoder() :
opts_(nullptr)
{
clear_timer_.setInterval(250);
clear_timer_.moveToThread(qApp->thread());
connect(&clear_timer_, &QTimer::timeout, this, &FFmpegDecoder::ClearTimerEvent);
}
@@ -178,7 +179,7 @@ bool FFmpegDecoder::Open()
second_ts_ = qRound64(av_q2d(av_inv_q(avstream_->time_base)));
clear_timer_.start();
QMetaObject::invokeMethod(&clear_timer_, "start");
}
// All allocation succeeded so we set the state to open