mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 03:27:40 +01:00
Fix the songloader test by making it wait for the gstreamer engine to finish initialisation
This commit is contained in:
parent
0c5d754135
commit
dedb9621e8
@ -85,7 +85,7 @@ GstEngine::GstEngine()
|
||||
}
|
||||
|
||||
GstEngine::~GstEngine() {
|
||||
initialising_.waitForFinished();
|
||||
EnsureInitialised();
|
||||
|
||||
current_pipeline_.reset();
|
||||
|
||||
@ -170,7 +170,7 @@ void GstEngine::ReloadSettings() {
|
||||
|
||||
|
||||
bool GstEngine::CanDecode(const QUrl &url) {
|
||||
initialising_.waitForFinished();
|
||||
EnsureInitialised();
|
||||
|
||||
// We had some bug reports claiming that video files cause crashes in canDecode(),
|
||||
// so don't try to decode them
|
||||
@ -398,7 +398,7 @@ void GstEngine::UpdateScope() {
|
||||
}
|
||||
|
||||
void GstEngine::StartPreloading(const QUrl& url) {
|
||||
initialising_.waitForFinished();
|
||||
EnsureInitialised();
|
||||
|
||||
if (autocrossfade_enabled_) {
|
||||
// Have to create a new pipeline so we can crossfade between the two
|
||||
@ -422,7 +422,7 @@ void GstEngine::StartPreloading(const QUrl& url) {
|
||||
}
|
||||
|
||||
bool GstEngine::Load(const QUrl& url, Engine::TrackChangeType change) {
|
||||
initialising_.waitForFinished();
|
||||
EnsureInitialised();
|
||||
|
||||
Engine::Base::Load(url, change);
|
||||
|
||||
@ -494,7 +494,7 @@ void GstEngine::StartFadeout() {
|
||||
|
||||
|
||||
bool GstEngine::Play( uint offset ) {
|
||||
initialising_.waitForFinished();
|
||||
EnsureInitialised();
|
||||
|
||||
QFuture<GstStateChangeReturn> future = current_pipeline_->SetState(GST_STATE_PLAYING);
|
||||
BoundFutureWatcher<GstStateChangeReturn, uint>* watcher =
|
||||
@ -707,7 +707,7 @@ GstElement* GstEngine::CreateElement(const QString& factoryName, GstElement* bin
|
||||
|
||||
GstEngine::PluginDetailsList
|
||||
GstEngine::GetPluginList(const QString& classname) const {
|
||||
const_cast<GstEngine*>(this)->initialising_.waitForFinished();
|
||||
const_cast<GstEngine*>(this)->EnsureInitialised();
|
||||
|
||||
PluginDetailsList ret;
|
||||
|
||||
@ -734,7 +734,7 @@ GstEngine::PluginDetailsList
|
||||
}
|
||||
|
||||
shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline() {
|
||||
initialising_.waitForFinished();
|
||||
EnsureInitialised();
|
||||
|
||||
shared_ptr<GstEnginePipeline> ret(new GstEnginePipeline(this));
|
||||
ret->set_output_device(sink_, device_);
|
||||
|
@ -64,6 +64,7 @@ class GstEngine : public Engine::Base, public BufferConsumer {
|
||||
static const char* kAutoSink;
|
||||
|
||||
bool Init();
|
||||
void EnsureInitialised() { initialising_.waitForFinished(); }
|
||||
|
||||
bool CanDecode(const QUrl& url);
|
||||
|
||||
|
@ -35,6 +35,7 @@ public:
|
||||
static void SetUpTestCase() {
|
||||
sGstEngine = new GstEngine;
|
||||
ASSERT_TRUE(sGstEngine->Init());
|
||||
sGstEngine->EnsureInitialised();
|
||||
}
|
||||
|
||||
static void TearDownTestCase() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user