Fix crash when stopping a track while a fadeout to pause is occuring. Fixes #4800.

This commit is contained in:
Andreas 2015-04-11 11:30:28 +02:00
parent 11d2702841
commit ec35688c86
1 changed files with 11 additions and 0 deletions

View File

@ -489,6 +489,17 @@ void GstEngine::Stop(bool stop_after) {
url_ = QUrl(); // To ensure we return Empty from state()
beginning_nanosec_ = end_nanosec_ = 0;
// Check if we started a fade out. If it isn't finished yet and the user
// pressed stop, we cancel the fader and just stop the playback.
if (is_fading_out_to_pause_) {
disconnect(current_pipeline_.get(), SIGNAL(FaderFinished()), 0, 0);
is_fading_out_to_pause_ = false;
has_faded_out_ = true;
fadeout_pause_pipeline_.reset();
fadeout_pipeline_.reset();
}
if (fadeout_enabled_ && current_pipeline_ && !stop_after) StartFadeout();
current_pipeline_.reset();