termux-packages/packages/hiptext/movie.cc.patch
2019-11-18 16:28:00 +02:00

30 lines
1.4 KiB
Diff

--- hiptext-2.0/src/movie.cc 2019-03-01 19:40:54.553801723 +0800
+++ hiptext-2.0_mod/src/movie.cc 2019-03-01 17:41:38.290586786 +0800
@@ -53,7 +53,7 @@
// Prepare context for scaling and converting to RGB.
sws_ = sws_getContext(context_->width, context_->height, context_->pix_fmt,
- width_, height_, PIX_FMT_RGB24, SWS_FAST_BILINEAR,
+ width_, height_, AV_PIX_FMT_RGB24, SWS_FAST_BILINEAR,
nullptr, nullptr, nullptr);
CHECK(codec_ = avcodec_find_decoder(context_->codec_id))
<< "Unsupported codec.\n";
@@ -61,13 +61,13 @@
<< "Could not open codec.\n";
// Allocate Raw + RGB frame buffers.
- CHECK(frame_ = avcodec_alloc_frame());
- CHECK(frame_rgb_ = avcodec_alloc_frame());
- int rgb_bytes = avpicture_get_size(PIX_FMT_RGB24, width_, height_);
+ CHECK(frame_ = av_frame_alloc());
+ CHECK(frame_rgb_ = av_frame_alloc());
+ int rgb_bytes = avpicture_get_size(AV_PIX_FMT_RGB24, width_, height_);
buffer_ = static_cast<uint8_t*>(av_malloc(rgb_bytes));
LOG(INFO) << "RGB Buffer: " << rgb_bytes << " bytes.";
int prep = avpicture_fill(reinterpret_cast<AVPicture*>(frame_rgb_),
- buffer_, PIX_FMT_RGB24, width_, height_);
+ buffer_, AV_PIX_FMT_RGB24, width_, height_);
CHECK_GE(prep, 0) << "Failed to prepare RGB buffer.";
LOG(INFO) << "RGB dimensions: " << width_ << "x" << height_;
}