Fix Deezer engine error state
This commit is contained in:
parent
c8dfb9b0db
commit
ba8717f95a
|
@ -495,7 +495,7 @@ int Player::GetVolume() const { return engine_->volume(); }
|
|||
|
||||
void Player::PlayAt(int index, Engine::TrackChangeFlags change, bool reshuffle) {
|
||||
|
||||
if (change == Engine::Manual && engine_->position_nanosec() != engine_->length_nanosec()) {
|
||||
if (current_item_ && change == Engine::Manual && engine_->position_nanosec() != engine_->length_nanosec()) {
|
||||
emit TrackSkipped(current_item_);
|
||||
const QUrl &url = current_item_->Url();
|
||||
if (url_handlers_.contains(url.scheme()) && !(engine_->type() == Engine::Deezer && url.scheme() == "dzmedia")) {
|
||||
|
|
|
@ -396,6 +396,7 @@ void DeezerEngine::PlayerEventCallback(dz_player_handle handle, dz_player_event_
|
|||
case DZ_PLAYER_EVENT_QUEUELIST_TRACK_NOT_AVAILABLE_OFFLINE:
|
||||
engine->state_ = Engine::Error;
|
||||
emit engine->StateChanged(engine->state_);
|
||||
emit engine->InvalidSongRequested(engine->media_url_);
|
||||
emit engine->Error("Track not available offline.");
|
||||
break;
|
||||
|
||||
|
@ -417,6 +418,7 @@ void DeezerEngine::PlayerEventCallback(dz_player_handle handle, dz_player_event_
|
|||
case DZ_PLAYER_EVENT_RENDER_TRACK_START_FAILURE:
|
||||
engine->state_ = Engine::Error;
|
||||
emit engine->StateChanged(engine->state_);
|
||||
emit engine->InvalidSongRequested(engine->media_url_);
|
||||
emit engine->Error("Track start failure.");
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue