mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-24 15:34:20 +00:00
Fail streaming on error in any stream.
This commit is contained in:
parent
2152fe6a79
commit
bfb6ecbac7
@ -219,15 +219,10 @@ bool Player::fileReady(Stream &&video, Stream &&audio) {
|
|||||||
streamReady(std::move(data));
|
streamReady(std::move(data));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const auto error = [&](auto &stream) {
|
const auto error = [=](Error error) {
|
||||||
return [=, &stream](Error error) {
|
crl::on_main(weak, [=] {
|
||||||
crl::on_main(weak, [=, &stream] {
|
streamFailed(error);
|
||||||
if (_stage == Stage::Initializing) {
|
});
|
||||||
stream = nullptr;
|
|
||||||
}
|
|
||||||
streamFailed(error);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
const auto mode = _options.mode;
|
const auto mode = _options.mode;
|
||||||
if ((mode != Mode::Audio && mode != Mode::Both)
|
if ((mode != Mode::Audio && mode != Mode::Both)
|
||||||
@ -254,7 +249,7 @@ bool Player::fileReady(Stream &&video, Stream &&audio) {
|
|||||||
std::move(audio),
|
std::move(audio),
|
||||||
_audioId,
|
_audioId,
|
||||||
ready,
|
ready,
|
||||||
error(_audio));
|
error);
|
||||||
} else if (audio.index >= 0) {
|
} else if (audio.index >= 0) {
|
||||||
LOG(("Streaming Error: No codec for audio stream %1, mode %2."
|
LOG(("Streaming Error: No codec for audio stream %1, mode %2."
|
||||||
).arg(audio.index
|
).arg(audio.index
|
||||||
@ -269,7 +264,7 @@ bool Player::fileReady(Stream &&video, Stream &&audio) {
|
|||||||
std::move(video),
|
std::move(video),
|
||||||
_audioId,
|
_audioId,
|
||||||
ready,
|
ready,
|
||||||
error(_video));
|
error);
|
||||||
} else if (video.index >= 0) {
|
} else if (video.index >= 0) {
|
||||||
LOG(("Streaming Error: No codec for video stream %1, mode %2."
|
LOG(("Streaming Error: No codec for video stream %1, mode %2."
|
||||||
).arg(video.index
|
).arg(video.index
|
||||||
@ -391,11 +386,7 @@ void Player::streamReady(Information &&information) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Player::streamFailed(Error error) {
|
void Player::streamFailed(Error error) {
|
||||||
if (_stage == Stage::Initializing) {
|
fail(error);
|
||||||
provideStartInformation();
|
|
||||||
} else {
|
|
||||||
fail(error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Track>
|
template <typename Track>
|
||||||
|
Loading…
Reference in New Issue
Block a user