FIX: ffmpeg swscale & frame_size

Change-Id: I9f4cb8c739b726f7e5cdbe0df7ed06b2eb2154d5
Jira: STUDIO-7624
(cherry picked from commit 5a2c75d835fb437667b590a803eef148baa30875)
This commit is contained in:
chunmao.guo
2024-07-16 17:44:52 +08:00
committed by Noisyfox
parent 297572dc03
commit fbc5dbcfd4
2 changed files with 6 additions and 3 deletions

View File

@@ -79,7 +79,7 @@ bool AVVideoDecoder::toWxImage(wxImage &image, wxSize const &size2)
sws_ctx_ = sws_getCachedContext(sws_ctx_,
frame_->width, frame_->height, AVPixelFormat(frame_->format),
size.GetWidth(), size.GetHeight(), wxFmt,
SWS_POINT, // SWS_FAST_BILINEAR //SWS_BICUBIC
SWS_GAUSS,
nullptr, nullptr, nullptr);
int length = size.GetWidth() * size.GetHeight() * 3;
if (bits_.size() < length)
@@ -108,7 +108,7 @@ bool AVVideoDecoder::toWxBitmap(wxBitmap &bitmap, wxSize const &size2)
sws_ctx_ = sws_getCachedContext(sws_ctx_,
frame_->width, frame_->height, AVPixelFormat(frame_->format),
size.GetWidth(), size.GetHeight(), wxFmt,
SWS_POINT, // SWS_FAST_BILINEAR //SWS_BICUBIC
SWS_GAUSS,
nullptr, nullptr, nullptr);
int length = size.GetWidth() * size.GetHeight() * 4;
if (bits_.size() < length)