GstEnginePipeline: Check that state is actually NULL before finishing pipeline
Possible fix for #1582
This commit is contained in:
parent
a0dd2c66e4
commit
ba285925ca
@ -404,7 +404,7 @@ bool GstEnginePipeline::Finish() {
|
|||||||
|
|
||||||
Disconnect();
|
Disconnect();
|
||||||
|
|
||||||
if (state() == GST_STATE_NULL) {
|
if (IsStateNull()) {
|
||||||
finished_ = true;
|
finished_ = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1784,6 +1784,19 @@ qint64 GstEnginePipeline::position() const {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GstEnginePipeline::IsStateNull() const {
|
||||||
|
|
||||||
|
if (!pipeline_) return true;
|
||||||
|
|
||||||
|
GstState s = GST_STATE_NULL, sp = GST_STATE_NULL;
|
||||||
|
if (gst_element_get_state(pipeline_, &s, &sp, kGstStateTimeoutNanosecs) == GST_STATE_CHANGE_FAILURE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return s == GST_STATE_NULL;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
QFuture<GstStateChangeReturn> GstEnginePipeline::SetStateAsync(const GstState state) {
|
QFuture<GstStateChangeReturn> GstEnginePipeline::SetStateAsync(const GstState state) {
|
||||||
|
|
||||||
qLog(Debug) << "Setting pipeline" << id() << "state to" << GstStateText(state);
|
qLog(Debug) << "Setting pipeline" << id() << "state to" << GstStateText(state);
|
||||||
|
@ -162,6 +162,7 @@ class GstEnginePipeline : public QObject {
|
|||||||
private:
|
private:
|
||||||
static QString GstStateText(const GstState state);
|
static QString GstStateText(const GstState state);
|
||||||
GstElement *CreateElement(const QString &factory_name, const QString &name, GstElement *bin, QString &error) const;
|
GstElement *CreateElement(const QString &factory_name, const QString &name, GstElement *bin, QString &error) const;
|
||||||
|
bool IsStateNull() const;
|
||||||
bool InitAudioBin(QString &error);
|
bool InitAudioBin(QString &error);
|
||||||
void SetupVolume(GstElement *element);
|
void SetupVolume(GstElement *element);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user