From f0963a332a5dccd0ae933f37615e9b732ae96580 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 4 Mar 2019 12:15:07 +0400 Subject: [PATCH] Fix crash on failed streaming. --- Telegram/SourceFiles/media/player/media_player_instance.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/media/player/media_player_instance.cpp b/Telegram/SourceFiles/media/player/media_player_instance.cpp index 71ba6b9f7..3cbd6f571 100644 --- a/Telegram/SourceFiles/media/player/media_player_instance.cpp +++ b/Telegram/SourceFiles/media/player/media_player_instance.cpp @@ -442,7 +442,8 @@ void Instance::stop(AudioMsgId::Type type) { void Instance::playPause(AudioMsgId::Type type) { if (const auto data = getData(type)) { if (data->streamed) { - if (data->streamed->player.finished()) { + if (data->streamed->player.finished() + || data->streamed->player.failed()) { auto options = Streaming::PlaybackOptions(); options.mode = Streaming::Mode::Audio; options.audioId = data->streamed->id;