gstengine: Use existing stream id to track background streams

New ids were being created for background stream mapping, but streams already
have unique IDs that can be used for this.
This commit is contained in:
Jim Broadus 2021-01-13 22:27:45 -08:00 committed by John Maguire
parent 72e2e62eb1
commit cf842a8c5a
3 changed files with 1 additions and 3 deletions

View File

@ -38,7 +38,6 @@ Engine::Base::Base()
crossfade_enabled_(true),
autocrossfade_enabled_(false),
crossfade_same_album_(false),
next_background_stream_id_(0),
about_to_end_emitted_(false) {}
Engine::Base::~Base() {}

View File

@ -149,7 +149,6 @@ class Base : public QObject {
bool crossfade_enabled_;
bool autocrossfade_enabled_;
bool crossfade_same_album_;
int next_background_stream_id_;
bool fadeout_pause_enabled_;
qint64 fadeout_pause_duration_nanosec_;

View File

@ -878,7 +878,7 @@ int GstEngine::AddBackgroundStream(shared_ptr<GstEnginePipeline> pipeline) {
connect(pipeline.get(), SIGNAL(EndOfStreamReached(int, bool)),
SLOT(BackgroundStreamFinished()));
const int stream_id = next_background_stream_id_++;
const int stream_id = pipeline->id();
background_streams_[stream_id] = pipeline;
QFuture<GstStateChangeReturn> future = pipeline->SetState(GST_STATE_PLAYING);