mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
parent
137fca73bd
commit
6f9a540a61
1 changed files with 6 additions and 1 deletions
|
@ -254,7 +254,9 @@ FrameGenerator::Frame FrameGenerator::Impl::renderNext(
|
||||||
QImage storage,
|
QImage storage,
|
||||||
QSize size,
|
QSize size,
|
||||||
Qt::AspectRatioMode mode) {
|
Qt::AspectRatioMode mode) {
|
||||||
if (!_current.frame) {
|
if (!_codec) {
|
||||||
|
return {};
|
||||||
|
} else if (!_current.frame) {
|
||||||
readNextFrame();
|
readNextFrame();
|
||||||
}
|
}
|
||||||
std::swap(_current, _next);
|
std::swap(_current, _next);
|
||||||
|
@ -266,6 +268,9 @@ FrameGenerator::Frame FrameGenerator::Impl::renderNext(
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameGenerator::Impl::jumpToStart() {
|
void FrameGenerator::Impl::jumpToStart() {
|
||||||
|
if (!_codec) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto result = 0;
|
auto result = 0;
|
||||||
if ((result = avformat_seek_file(_format.get(), _streamId, std::numeric_limits<int64_t>::min(), 0, std::numeric_limits<int64_t>::max(), 0)) < 0) {
|
if ((result = avformat_seek_file(_format.get(), _streamId, std::numeric_limits<int64_t>::min(), 0, std::numeric_limits<int64_t>::max(), 0)) < 0) {
|
||||||
if ((result = av_seek_frame(_format.get(), _streamId, 0, AVSEEK_FLAG_BYTE)) < 0) {
|
if ((result = av_seek_frame(_format.get(), _streamId, 0, AVSEEK_FLAG_BYTE)) < 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue